Skip to content

Commit 0921835

Browse files
chaseyuJaegeuk Kim
authored andcommitted
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 <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 280fd42 commit 0921835

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fs/f2fs/f2fs.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1640,6 +1640,7 @@ static inline void clear_ckpt_flags(struct f2fs_sb_info *sbi, unsigned int f)
16401640
static inline void disable_nat_bits(struct f2fs_sb_info *sbi, bool lock)
16411641
{
16421642
unsigned long flags;
1643+
unsigned char *nat_bits;
16431644

16441645
/*
16451646
* 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)
16501651
if (lock)
16511652
spin_lock_irqsave(&sbi->cp_lock, flags);
16521653
__clear_ckpt_flags(F2FS_CKPT(sbi), CP_NAT_BITS_FLAG);
1653-
kvfree(NM_I(sbi)->nat_bits);
1654+
nat_bits = NM_I(sbi)->nat_bits;
16541655
NM_I(sbi)->nat_bits = NULL;
16551656
if (lock)
16561657
spin_unlock_irqrestore(&sbi->cp_lock, flags);
1658+
1659+
kvfree(nat_bits);
16571660
}
16581661

16591662
static inline bool enabled_nat_bits(struct f2fs_sb_info *sbi,

0 commit comments

Comments
 (0)