diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-06-19 14:10:53 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-07-06 17:40:03 -0400 |
commit | 5fbfb238f7a0a5c4633438eb5bdfb4810995c76a (patch) | |
tree | c68104c989955e2b379851560b4643f1cdf5591f /fs/ufs | |
parent | 4eeff4c9326878ff58ef6fe68d2bf22ef877e5a2 (diff) |
ufs_inode_getblock(): failure to read an indirect block is -EIO
... and not "write to beginning of the disk", TYVM...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ufs')
-rw-r--r-- | fs/ufs/inode.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c index f2d8cc2166af..ed70147e1cb4 100644 --- a/fs/ufs/inode.c +++ b/fs/ufs/inode.c | |||
@@ -349,8 +349,10 @@ ufs_inode_getblock(struct inode *inode, u64 ind_block, | |||
349 | return 0; | 349 | return 0; |
350 | 350 | ||
351 | bh = sb_bread(sb, ind_block + (index >> shift)); | 351 | bh = sb_bread(sb, ind_block + (index >> shift)); |
352 | if (unlikely(!bh)) | 352 | if (unlikely(!bh)) { |
353 | *err = -EIO; | ||
353 | return 0; | 354 | return 0; |
355 | } | ||
354 | 356 | ||
355 | index &= uspi->s_apbmask >> uspi->s_fpbshift; | 357 | index &= uspi->s_apbmask >> uspi->s_fpbshift; |
356 | if (uspi->fs_magic == UFS2_MAGIC) | 358 | if (uspi->fs_magic == UFS2_MAGIC) |
@@ -454,7 +456,6 @@ static int ufs_getfrag_block(struct inode *inode, sector_t fragment, struct buff | |||
454 | phys64 = ufs_inode_getblock(inode, phys64, offsets[depth - 1], | 456 | phys64 = ufs_inode_getblock(inode, phys64, offsets[depth - 1], |
455 | fragment, &err, &phys, &new, bh_result->b_page); | 457 | fragment, &err, &phys, &new, bh_result->b_page); |
456 | } | 458 | } |
457 | out: | ||
458 | if (phys64) { | 459 | if (phys64) { |
459 | phys64 += frag; | 460 | phys64 += frag; |
460 | phys = phys64; | 461 | phys = phys64; |