diff options
author | Dmitry Monakhov <dmonakhov@openvz.org> | 2012-09-29 00:41:21 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2012-09-29 00:41:21 -0400 |
commit | 17335dcc471199717839b2fa3492ca36f70f1168 (patch) | |
tree | 5f39f51868f60f8be94ca7e811d34bba443ef288 /fs/ext4/inode.c | |
parent | 28a535f9a0df060569dcc786e5bc2e1de43d7dc7 (diff) |
ext4: serialize dio nonlocked reads with defrag workers
Inode's block defrag and ext4_change_inode_journal_flag() may
affect nonlocked DIO reads result, so proper synchronization
required.
- Add missed inode_dio_wait() calls where appropriate
- Check inode state under extra i_dio_count reference.
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r-- | fs/ext4/inode.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 09d0488e9a15..bdd399bc2abf 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -4720,6 +4720,10 @@ int ext4_change_inode_journal_flag(struct inode *inode, int val) | |||
4720 | return err; | 4720 | return err; |
4721 | } | 4721 | } |
4722 | 4722 | ||
4723 | /* Wait for all existing dio workers */ | ||
4724 | ext4_inode_block_unlocked_dio(inode); | ||
4725 | inode_dio_wait(inode); | ||
4726 | |||
4723 | jbd2_journal_lock_updates(journal); | 4727 | jbd2_journal_lock_updates(journal); |
4724 | 4728 | ||
4725 | /* | 4729 | /* |
@@ -4739,6 +4743,7 @@ int ext4_change_inode_journal_flag(struct inode *inode, int val) | |||
4739 | ext4_set_aops(inode); | 4743 | ext4_set_aops(inode); |
4740 | 4744 | ||
4741 | jbd2_journal_unlock_updates(journal); | 4745 | jbd2_journal_unlock_updates(journal); |
4746 | ext4_inode_resume_unlocked_dio(inode); | ||
4742 | 4747 | ||
4743 | /* Finally we can mark the inode as dirty. */ | 4748 | /* Finally we can mark the inode as dirty. */ |
4744 | 4749 | ||