From: Akinobu Mita Date: Thu, 17 Apr 2008 14:38:59 +0000 (-0400) Subject: ext4: check ext4_journal_get_write_access() errors X-Git-Tag: v2.6.26-rc1~345^2~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a871611b474bfcdee422c0cf5d16f509dce096f5;p=platform%2Fupstream%2Fkernel-adaptation-pc.git ext4: check ext4_journal_get_write_access() errors Check ext4_journal_get_write_access() errors. Signed-off-by: Akinobu Mita Signed-off-by: "Theodore Ts'o" Cc: Stephen Tweedie Cc: adilger@clusterfs.com Cc: Andrew Morton Cc: Mingming Cao --- diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 6861194..63c33e0 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -57,10 +57,15 @@ static struct buffer_head *ext4_append(handle_t *handle, *block = inode->i_size >> inode->i_sb->s_blocksize_bits; - if ((bh = ext4_bread(handle, inode, *block, 1, err))) { + bh = ext4_bread(handle, inode, *block, 1, err); + if (bh) { inode->i_size += inode->i_sb->s_blocksize; EXT4_I(inode)->i_disksize = inode->i_size; - ext4_journal_get_write_access(handle,bh); + *err = ext4_journal_get_write_access(handle, bh); + if (*err) { + brelse(bh); + bh = NULL; + } } return bh; }