Skip to content

Commit

Permalink
ufs_inode_getblock(): failure to read an indirect block is -EIO
Browse files Browse the repository at this point in the history
... and not "write to beginning of the disk", TYVM...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Jul 6, 2015
1 parent 4eeff4c commit 5fbfb23
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/ufs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 5fbfb23

Please sign in to comment.