]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ufs_inode_getblock(): failure to read an indirect block is -EIO
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 19 Jun 2015 18:10:53 +0000 (14:10 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 6 Jul 2015 21:40:03 +0000 (17:40 -0400)
... and not "write to beginning of the disk", TYVM...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/ufs/inode.c

index f2d8cc2166afeccf1c3390d85119929643d0b9e5..ed70147e1cb4150c9ffba87dd82eedbc82c3340d 100644 (file)
@@ -349,8 +349,10 @@ ufs_inode_getblock(struct inode *inode, u64 ind_block,
                return 0;
 
        bh = sb_bread(sb, ind_block + (index >> shift));
-       if (unlikely(!bh))
+       if (unlikely(!bh)) {
+               *err = -EIO;
                return 0;
+       }
 
        index &= uspi->s_apbmask >> uspi->s_fpbshift;
        if (uspi->fs_magic == UFS2_MAGIC)
@@ -454,7 +456,6 @@ static int ufs_getfrag_block(struct inode *inode, sector_t fragment, struct buff
                phys64 = ufs_inode_getblock(inode, phys64, offsets[depth - 1],
                                        fragment, &err, &phys, &new, bh_result->b_page);
        }
-out:
        if (phys64) {
                phys64 += frag;
                phys = phys64;