diff options
author | Eric Gouriou <egouriou@google.com> | 2011-05-22 21:33:00 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2011-05-22 21:33:00 -0400 |
commit | f6d2f6b327ceef5c689581529a852dc6ec3b74a6 (patch) | |
tree | 9ae24dbb3787f596687954322c55e73570d6ed88 /fs/ext4 | |
parent | 77f4135f2a219a2127be6cc1208c42e6175b11dd (diff) | |
download | op-kernel-dev-f6d2f6b327ceef5c689581529a852dc6ec3b74a6.zip op-kernel-dev-f6d2f6b327ceef5c689581529a852dc6ec3b74a6.tar.gz |
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>
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/extents.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 4444317..4e2bdc2 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -3450,8 +3450,9 @@ void ext4_ext_truncate(struct inode *inode) if (IS_SYNC(inode)) ext4_handle_sync(handle); -out_stop: up_write(&EXT4_I(inode)->i_data_sem); + +out_stop: /* * If this was a simple ftruncate() and the file will remain alive, * then we need to clear up the orphan record which we created above. |