From: Stefan Seyfried <stefan.seyfried@googlemail.com>
To: linux-kernel@vger.kernel.org
Cc: w@1wt.eu, Stefan Seyfried <seife@sphairon.com>
Subject: [PATCH 2.4] FAT: do not continue in fat_get_block if bmap fails
Date: Tue, 2 Feb 2010 14:00:35 +0100 [thread overview]
Message-ID: <1265115635-22612-1-git-send-email-stefan.seyfried@googlemail.com> (raw)
From: Stefan Seyfried <seife@sphairon.com>
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>
---
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 ade1a71..75efe74 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);
--
1.6.4.2
next reply other threads:[~2010-02-02 13:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-02 13:00 Stefan Seyfried [this message]
2010-02-02 22:06 ` Willy Tarreau
2010-02-03 9:14 ` Stefan Seyfried
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1265115635-22612-1-git-send-email-stefan.seyfried@googlemail.com \
--to=stefan.seyfried@googlemail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=seife@sphairon.com \
--cc=w@1wt.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®