public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4/4] ext3: check ext3_journal_get_write_access() errors
@ 2008-02-17  6:06 Akinobu Mita
  0 siblings, 0 replies; only message in thread
From: Akinobu Mita @ 2008-02-17  6:06 UTC (permalink / raw)
  To: linux-ext4; +Cc: Andrew Morton, Stephen Tweedie, adilger

Check ext3_journal_get_write_access() errors.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: adilger@clusterfs.com
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 fs/ext3/namei.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Index: 2.6-rc/fs/ext3/namei.c
===================================================================
--- 2.6-rc.orig/fs/ext3/namei.c
+++ 2.6-rc/fs/ext3/namei.c
@@ -57,10 +57,15 @@ static struct buffer_head *ext3_append(h
 
 	*block = inode->i_size >> inode->i_sb->s_blocksize_bits;
 
-	if ((bh = ext3_bread(handle, inode, *block, 1, err))) {
+	bh = ext3_bread(handle, inode, *block, 1, err);
+	if (bh) {
 		inode->i_size += inode->i_sb->s_blocksize;
 		EXT3_I(inode)->i_disksize = inode->i_size;
-		ext3_journal_get_write_access(handle,bh);
+		*err = ext3_journal_get_write_access(handle, bh);
+		if (*err) {
+			brelse(bh);
+			bh = NULL;
+		}
 	}
 	return bh;
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-02-17  6:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-17  6:06 [PATCH 4/4] ext3: check ext3_journal_get_write_access() errors Akinobu Mita

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox