OSDN Git Service

f2fs: add a rw_sem to cover quota flag changes
authorJaegeuk Kim <jaegeuk@kernel.org>
Wed, 29 May 2019 17:58:45 +0000 (10:58 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Sat, 13 Jul 2019 01:35:02 +0000 (18:35 -0700)
commit783ea2b658ff8163a2c3de7817aaf56fcdaf0f08
tree20c8d00444e720d2b34d2a942fff0b5174f9a493
parente115c85439c302e2e4b355965f26968ff270454a
f2fs: add a rw_sem to cover quota flag changes

Two paths to update quota and f2fs_lock_op:

1.
 - lock_op
 |  - quota_update
 `- unlock_op

2.
 - quota_update
 - lock_op
 `- unlock_op

But, we need to make a transaction on quota_update + lock_op in #2 case.
So, this patch introduces:
1. lock_op
2. down_write
3. check __need_flush
4. up_write
5. if there is dirty quota entries, flush them
6. otherwise, good to go

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/checkpoint.c
fs/f2fs/f2fs.h
fs/f2fs/super.c