diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2019-05-29 19:58:45 +0200 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2019-07-03 00:40:41 +0200 |
commit | db6ec53b7e0320c8fad27e9a816e50080154bd51 (patch) | |
tree | 0d8860ebf1d7cf5132e47ce36c510905807563ca /fs/f2fs/f2fs.h | |
parent | f2fs: set SBI_NEED_FSCK for xattr corruption case (diff) | |
download | linux-db6ec53b7e0320c8fad27e9a816e50080154bd51.tar.xz linux-db6ec53b7e0320c8fad27e9a816e50080154bd51.zip |
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>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r-- | fs/f2fs/f2fs.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index d643f05cfa34..41a37ffabb8e 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -1256,6 +1256,7 @@ struct f2fs_sb_info { block_t unusable_block_count; /* # of blocks saved by last cp */ unsigned int nquota_files; /* # of quota sysfile */ + struct rw_semaphore quota_sem; /* blocking cp for flags */ /* # of pages, see count_type */ atomic_t nr_pages[NR_COUNT_TYPE]; |