diff options
author | Stefan Seyfried <seife@sphairon.com> | 2010-02-02 14:00:35 +0100 |
---|---|---|
committer | Willy Tarreau <w@1wt.eu> | 2010-02-02 23:06:45 +0100 |
commit | 940716e5206ebda003fca89b4ac1076b1fff5c99 (patch) | |
tree | 092922e057d7ebb8d9a3ec23d60e43e89774e449 | |
parent | e57c78b89a7ac792aa527ec41d7288b5a42cf169 (diff) | |
download | linux-2.4-940716e5206ebda003fca89b4ac1076b1fff5c99.tar.gz |
FAT: do not continue in fat_get_block if bmap fails
There is no use in continuing the write operation after fat_bmap() fails.
(This successfully killed a VFAT FS for me).
The corresponding code in 2.6 does return here as well, AFAICT.
Signed-off-by: Stefan Seyfried <seife@sphairon.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
-rw-r--r-- | fs/fat/file.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/fat/file.c b/fs/fat/file.c index ade1a71bf50ae7..75efe7484ec1dd 100644 --- a/fs/fat/file.c +++ b/fs/fat/file.c @@ -72,8 +72,10 @@ int fat_get_block(struct inode *inode, long iblock, struct buffer_head *bh_resul } MSDOS_I(inode)->mmu_private += sb->s_blocksize; phys = fat_bmap(inode, iblock); - if (!phys) + if (!phys) { BUG(); + return -EIO; + } bh_result->b_dev = inode->i_dev; bh_result->b_blocknr = phys; bh_result->b_state |= (1UL << BH_Mapped); |