]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: fix unbalanced up_write() in ext4_ext_truncate() error path
authorEric Gouriou <egouriou@google.com>
Mon, 23 May 2011 01:33:00 +0000 (21:33 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 23 May 2011 01:33:00 +0000 (21:33 -0400)
commitdd34add479f83fbc80571e156fc7d3224af70ae1
tree9ae24dbb3787f596687954322c55e73570d6ed88
parentaac38d80659f1f42c9706fa6e738c2a746124588
ext4: fix unbalanced up_write() in ext4_ext_truncate() error path

ext4_ext_truncate() should not invoke up_write(&EXT4_I(inode)->i_data_sem)
when ext4_orphan_add() returns an error, as it hasn't performed a
down_write() yet. This trivial patch fixes this by moving the up_write()
invocation above the out_stop label.

Signed-off-by: Eric Gouriou <egouriou@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/extents.c