summaryrefslogtreecommitdiffstats
path: root/fs/ext4/fsync.c
diff options
context:
space:
mode:
authorTao Ma <boyu.mt@taobao.com>2011-10-30 18:26:08 -0400
committerTheodore Ts'o <tytso@mit.edu>2011-10-30 18:26:08 -0400
commitd73d5046a72467d4510825b99e2269e09ad80e15 (patch)
tree4ac8b5729e1aeffe8348557a7f77da1791c268cc /fs/ext4/fsync.c
parent6d6a435190bdf2e04c9465cde5bdc3ac68cf11a4 (diff)
ext4: Use correct locking for ext4_end_io_nolock()
We must hold i_completed_io_lock when manipulating anything on the i_completed_io_list linked list. This includes io->lock, which we were checking in ext4_end_io_nolock(). So move this check to ext4_end_io_work(). This also has the bonus of avoiding extra work if it is already done without needing to take the mutex. Signed-off-by: Tao Ma <boyu.mt@taobao.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/fsync.c')
-rw-r--r--fs/ext4/fsync.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c
index c942924a064..851ac5b3cec 100644
--- a/fs/ext4/fsync.c
+++ b/fs/ext4/fsync.c
@@ -83,9 +83,6 @@ int ext4_flush_completed_IO(struct inode *inode)
int ret = 0;
int ret2 = 0;
- if (list_empty(&ei->i_completed_io_list))
- return ret;
-
dump_completed_IO(inode);
spin_lock_irqsave(&ei->i_completed_io_lock, flags);
while (!list_empty(&ei->i_completed_io_list)){