diff options
author | alex chen <alex.chen@huawei.com> | 2014-04-03 17:47:05 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-06 10:55:32 -0400 |
commit | 5da43e877ea4e51b1096a8973ff6e7a03554fcb0 (patch) | |
tree | 7790d184a999db18d28f8d31ab078d4ca7f5eaa6 | |
parent | a093bceda6927de680e1c16793c5dfc4df3d236f (diff) |
ocfs2: do not put bh when buffer_uptodate failed
commit f7cf4f5bfe073ad792ab49c04f247626b3e38db6 upstream.
Do not put bh when buffer_uptodate failed in ocfs2_write_block and
ocfs2_write_super_or_backup, because it will put bh in b_end_io.
Otherwise it will hit a warning "VFS: brelse: Trying to free free
buffer".
Signed-off-by: Alex Chen <alex.chen@huawei.com>
Reviewed-by: Joseph Qi <joseph.qi@huawei.com>
Reviewed-by: Srinivas Eeda <srinivas.eeda@oracle.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Acked-by: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | fs/ocfs2/buffer_head_io.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/fs/ocfs2/buffer_head_io.c b/fs/ocfs2/buffer_head_io.c index 5d18ad10c27f..4f66e007dae1 100644 --- a/fs/ocfs2/buffer_head_io.c +++ b/fs/ocfs2/buffer_head_io.c | |||
@@ -90,7 +90,6 @@ int ocfs2_write_block(struct ocfs2_super *osb, struct buffer_head *bh, | |||
90 | * information for this bh as it's not marked locally | 90 | * information for this bh as it's not marked locally |
91 | * uptodate. */ | 91 | * uptodate. */ |
92 | ret = -EIO; | 92 | ret = -EIO; |
93 | put_bh(bh); | ||
94 | mlog_errno(ret); | 93 | mlog_errno(ret); |
95 | } | 94 | } |
96 | 95 | ||
@@ -420,7 +419,6 @@ int ocfs2_write_super_or_backup(struct ocfs2_super *osb, | |||
420 | 419 | ||
421 | if (!buffer_uptodate(bh)) { | 420 | if (!buffer_uptodate(bh)) { |
422 | ret = -EIO; | 421 | ret = -EIO; |
423 | put_bh(bh); | ||
424 | mlog_errno(ret); | 422 | mlog_errno(ret); |
425 | } | 423 | } |
426 | 424 | ||