fs: Remove bogus wait in write_inode_now()
authorJan Kara <jack@suse.cz>
Fri, 9 Mar 2012 15:26:07 +0000 (07:26 -0800)
committerFengguang Wu <fengguang.wu@intel.com>
Wed, 21 Mar 2012 07:26:47 +0000 (15:26 +0800)
inode_sync_wait() in write_inode_now() is just bogus. That function waits for
I_SYNC bit to be cleared but writeback_single_inode() clears the bit on return
so the wait is effectivelly a nop unless someone else submits the inode for
writeback again. All the waiting write_inode_now() needs is achieved by using
WB_SYNC_ALL writeback mode.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
fs/fs-writeback.c

index 5b4a936..f60297b 100644 (file)
@@ -1364,8 +1364,6 @@ int write_inode_now(struct inode *inode, int sync)
        ret = writeback_single_inode(inode, wb, &wbc);
        spin_unlock(&inode->i_lock);
        spin_unlock(&wb->list_lock);
-       if (sync)
-               inode_sync_wait(inode);
        return ret;
 }
 EXPORT_SYMBOL(write_inode_now);