On 2020/3/23 10:00, Joe Perches wrote:
> On Mon, 2020-03-23 at 09:25 +0800, Chao Yu wrote:
>> f2fs_inode_info.flags is unsigned long variable, it has 32 bits
>> in 32bit architecture, since we introduced FI_MMAP_FILE flag
>> when we support data compression, we may access memory cross
>> the border
Hello Ondřej,
On 2020/3/23 9:50, Ondřej Jirman wrote:
> Hello Chao Yu,
>
> On Mon, Mar 23, 2020 at 09:25:19AM +0800, Chao Yu wrote:
>> [snip]
>>
>> +static inline void __set_inode_flag(struct inode *inode, int flag)
>> +{
>> +test_and_set_bit(flag % BITS_PER_LONG,
>> +&F
On Mon, 2020-03-23 at 09:25 +0800, Chao Yu wrote:
> f2fs_inode_info.flags is unsigned long variable, it has 32 bits
> in 32bit architecture, since we introduced FI_MMAP_FILE flag
> when we support data compression, we may access memory cross
> the border of .flags field, corrupting .i_sem field, re
Hello Chao Yu,
On Mon, Mar 23, 2020 at 09:25:19AM +0800, Chao Yu wrote:
> [snip]
>
> +static inline void __set_inode_flag(struct inode *inode, int flag)
> +{
> + test_and_set_bit(flag % BITS_PER_LONG,
> + &F2FS_I(inode)->flags[BIT_WORD(flag)]);
This can simply be:
t
f2fs_inode_info.flags is unsigned long variable, it has 32 bits
in 32bit architecture, since we introduced FI_MMAP_FILE flag
when we support data compression, we may access memory cross
the border of .flags field, corrupting .i_sem field, result in
below deadlock.
To fix this issue, let's expand .