diff options
author | Chao Yu <yuchao0@huawei.com> | 2019-07-26 15:43:17 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2019-08-23 07:57:12 -0700 |
commit | 0921835c9544c1dc3d2093df6932f1b207eec487 (patch) | |
tree | 894920dfc5532d767cf09eaf77cc81b001b871c7 /fs/f2fs/f2fs.h | |
parent | 280fd422958187ac5f069c08d84dd65f7f87c2e6 (diff) | |
download | linux-0921835c9544c1dc3d2093df6932f1b207eec487.tar.gz linux-0921835c9544c1dc3d2093df6932f1b207eec487.tar.bz2 linux-0921835c9544c1dc3d2093df6932f1b207eec487.zip |
f2fs: fix to avoid call kvfree under spinlock
vfree() don't wish to be called from interrupt context, move it
out of spin_lock_irqsave() coverage.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r-- | fs/f2fs/f2fs.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 17382da7f0bd..4fa9a618b31a 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -1640,6 +1640,7 @@ static inline void clear_ckpt_flags(struct f2fs_sb_info *sbi, unsigned int f) static inline void disable_nat_bits(struct f2fs_sb_info *sbi, bool lock) { unsigned long flags; + unsigned char *nat_bits; /* * In order to re-enable nat_bits we need to call fsck.f2fs by @@ -1650,10 +1651,12 @@ static inline void disable_nat_bits(struct f2fs_sb_info *sbi, bool lock) if (lock) spin_lock_irqsave(&sbi->cp_lock, flags); __clear_ckpt_flags(F2FS_CKPT(sbi), CP_NAT_BITS_FLAG); - kvfree(NM_I(sbi)->nat_bits); + nat_bits = NM_I(sbi)->nat_bits; NM_I(sbi)->nat_bits = NULL; if (lock) spin_unlock_irqrestore(&sbi->cp_lock, flags); + + kvfree(nat_bits); } static inline bool enabled_nat_bits(struct f2fs_sb_info *sbi, |