]> git.baikalelectronics.ru Git - kernel.git/commit
jbd2: fix sending of data flush on journal commit
authorJan Kara <jack@suse.cz>
Tue, 24 May 2011 15:52:40 +0000 (11:52 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 24 May 2011 15:52:40 +0000 (11:52 -0400)
commit4fe04fca6cc575fe4b48d7da37ba44e1935d1d85
treeb535687e88af17fc6b25329decf28563ed519395
parent9291bab3ca060b157e12171b48c49f8e65fca320
jbd2: fix sending of data flush on journal commit

In data=ordered mode, it's theoretically possible (however rare) that
an inode is filed to transaction's t_inode_list and a flusher thread
writes all the data and inode is reclaimed before the transaction
starts to commit.  In such a case, we could erroneously omit sending a
flush to file system device when it is different from the journal
device (because data can still be in disk cache only).

Fix the problem by setting a flag in a transaction when some inode is added
to it and then send disk flush in the commit code when the flag is set.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/jbd2/commit.c
fs/jbd2/transaction.c
include/linux/jbd2.h