Re: [f2fs-dev] [PATCH v2] f2fs: use kmem_cache pool during inline xattr lookups

2020-03-22 Thread Jaegeuk Kim
On 03/19, Chao Yu wrote: > Hi Ju Hyung, > > On 2020/3/18 20:14, Ju Hyung Park wrote: > > Hi Chao. > > > > I got the time around to test this patch. > > The v2 patch seems to work just fine, and the code looks good. > > Thanks a lot for the review and test. > > > > > On Tue, Feb 25, 2020 at

Re: [f2fs-dev] fstrim does not recognize FSVER=1.13 of F2FS partitions

2020-03-22 Thread Jaegeuk Kim
On 03/18, John wrote: > On Mon, Mar 16, 2020 at 9:44 PM Chao Yu wrote: > > > > On 2020/3/16 17:52, John wrote: > > > On Sun, Mar 15, 2020 at 9:24 PM Chao Yu wrote: > > >> > > >> What's your mount option and mkfs option on those two partitions, and > > >> what's > > >> your kernel version? > > >

Re: [f2fs-dev] [PATCH v9 22/25] f2fs: Convert from readpages to readahead

2020-03-22 Thread Jaegeuk Kim
On 03/20, Matthew Wilcox wrote: > From: "Matthew Wilcox (Oracle)" > > Use the new readahead operation in f2fs > > Signed-off-by: Matthew Wilcox (Oracle) > Reviewed-by: William Kucharski Acked-by: Jaegeuk Kim > --- > fs/f2fs/data.c | 47 +++-- >

Re: [f2fs-dev] [PATCH v9 23/25] f2fs: Pass the inode to f2fs_mpage_readpages

2020-03-22 Thread Jaegeuk Kim
On 03/20, Matthew Wilcox wrote: > From: "Matthew Wilcox (Oracle)" > > This function now only uses the mapping argument to look up the inode, > and both callers already have the inode, so just pass the inode instead > of the mapping. > > Signed-off-by: Matthew Wilcox (Oracle) > Reviewed-by:

Re: [f2fs-dev] [PATCH v4] f2fs: fix potential .flags overflow on 32bit architecture

2020-03-22 Thread Chao Yu
On 2020/3/23 10:57, Joe Perches wrote: > On Mon, 2020-03-23 at 10:41 +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

[f2fs-dev] [PATCH v5] f2fs: fix potential .flags overflow on 32bit architecture

2020-03-22 Thread Chao Yu
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

Re: [f2fs-dev] [PATCH v4] f2fs: fix potential .flags overflow on 32bit architecture

2020-03-22 Thread Chao Yu
On 2020/3/23 11:05, Ondřej Jirman wrote: > Hello, > > On Mon, Mar 23, 2020 at 10:41:09AM +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

Re: [f2fs-dev] [PATCH v4] f2fs: fix potential .flags overflow on 32bit architecture

2020-03-22 Thread Ondřej Jirman
Hello, On Mon, Mar 23, 2020 at 10:41:09AM +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

Re: [f2fs-dev] [PATCH v4] f2fs: fix potential .flags overflow on 32bit architecture

2020-03-22 Thread Joe Perches
On Mon, 2020-03-23 at 10:41 +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,

[f2fs-dev] [PATCH v4] f2fs: fix potential .flags overflow on 32bit architecture

2020-03-22 Thread Chao Yu
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

Re: [f2fs-dev] [PATCH v3] f2fs: fix potential .flags overflow on 32bit architecture

2020-03-22 Thread Chao Yu
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

Re: [f2fs-dev] [PATCH v3] f2fs: fix potential .flags overflow on 32bit architecture

2020-03-22 Thread Chao Yu
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, >> +

Re: [f2fs-dev] [PATCH v3] f2fs: fix potential .flags overflow on 32bit architecture

2020-03-22 Thread Joe Perches
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: [f2fs-dev] [PATCH v3] fsck.f2fs: allow fsck to fix issues with online resize due to SPO

2020-03-22 Thread Chao Yu
On 2020/3/20 11:53, Sahitya Tummala wrote: > Add support for new CP flag CP_RESIZEFS_FLAG set during online > resize FS. If SPO happens after SB is updated but CP isn't, then > allow fsck to fix it. > > The fsck errors without this fix - > Info: CKPT version = 6ed7bccb > Wrong

Re: [f2fs-dev] [PATCH v3] f2fs: fix potential .flags overflow on 32bit architecture

2020-03-22 Thread Ondřej Jirman
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, > + _I(inode)->flags[BIT_WORD(flag)]); This can simply be:

Re: [f2fs-dev] [PATCH] ENOSPC returned but there still many free segments

2020-03-22 Thread Chao Yu
On 2020/3/21 9:31, chenying wrote: > I write data to a compressed file when the disk space is almost full > and it return -ENOSPC error, but cat /sys/kernel/debug/f2fs/status > shows that there still many free segments. free segments include reserved segments, so its value should never be zero,

[f2fs-dev] [PATCH v3] f2fs: fix potential .flags overflow on 32bit architecture

2020-03-22 Thread Chao Yu
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

Re: [f2fs-dev] [PATCH] f2fs: fix potential .flags overflow on 32bit architecture

2020-03-22 Thread Chao Yu
On 2020/3/22 23:30, Ondřej Jirman wrote: > On Sun, Mar 22, 2020 at 09:18:56PM +0800, Chao Yu wrote: >> Hi, >> >> On 2020-3-22 20:14, Ondřej Jirman wrote: >>> Hello, >>> >>> On Sun, Mar 22, 2020 at 06:13:27PM +0800, Chao Yu wrote: From: Chao Yu f2fs_inode_info.flags is unsigned long

Re: [f2fs-dev] [PATCH v2] f2fs: fix potential .flags overflow on 32bit architecture

2020-03-22 Thread Chao Yu
On 2020/3/22 22:56, Joe Perches wrote: > On Sun, 2020-03-22 at 21:56 +0800, Chao Yu wrote: >> From: Chao Yu >> >> 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

Re: [f2fs-dev] [PATCH v9 12/25] mm: Move end_index check out of readahead loop

2020-03-22 Thread Matthew Wilcox
On Fri, Mar 20, 2020 at 11:24:52AM -0700, Eric Biggers wrote: > On Fri, Mar 20, 2020 at 11:11:32AM -0700, Matthew Wilcox wrote: > > On Fri, Mar 20, 2020 at 11:00:17AM -0700, Eric Biggers wrote: > > > But then if someone passes index=0 and nr_to_read=0, this underflows and > > > the > > > entire

Re: [f2fs-dev] [PATCH] f2fs: fix potential .flags overflow on 32bit architecture

2020-03-22 Thread Ondřej Jirman
On Sun, Mar 22, 2020 at 09:18:56PM +0800, Chao Yu wrote: > Hi, > > On 2020-3-22 20:14, Ondřej Jirman wrote: > > Hello, > > > > On Sun, Mar 22, 2020 at 06:13:27PM +0800, Chao Yu wrote: > > > From: Chao Yu > > > > > > f2fs_inode_info.flags is unsigned long variable, it has 32 bits > > > in 32bit

Re: [f2fs-dev] [PATCH v2] f2fs: fix potential .flags overflow on 32bit architecture

2020-03-22 Thread Joe Perches
On Sun, 2020-03-22 at 21:56 +0800, Chao Yu wrote: > From: Chao Yu > > 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,

[f2fs-dev] [PATCH v2] f2fs: fix potential .flags overflow on 32bit architecture

2020-03-22 Thread Chao Yu
From: Chao Yu 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

Re: [f2fs-dev] [PATCH] f2fs: fix potential .flags overflow on 32bit architecture

2020-03-22 Thread Chao Yu
Hi, On 2020-3-22 20:14, Ondřej Jirman wrote: Hello, On Sun, Mar 22, 2020 at 06:13:27PM +0800, Chao Yu wrote: From: Chao Yu 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

Re: [f2fs-dev] [PATCH] f2fs: fix potential .flags overflow on 32bit architecture

2020-03-22 Thread Ondřej Jirman
Hello, On Sun, Mar 22, 2020 at 06:13:27PM +0800, Chao Yu wrote: > From: Chao Yu > > 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

Re: [f2fs-dev] Writes stoped working on f2fs after the compression support was added

2020-03-22 Thread Chao Yu
Hi all, I've figure out a patch for this issue, could you please try below one? f2fs: fix potential .flags overflow on 32bit architecture Thanks, On 2020-3-12 1:01, Jaegeuk Kim wrote: On 03/06, Ondřej Jirman wrote: Hello, On Thu, Feb 27, 2020 at 10:01:50AM +0800, Chao Yu wrote: On

[f2fs-dev] [PATCH] f2fs: fix potential .flags overflow on 32bit architecture

2020-03-22 Thread Chao Yu
From: Chao Yu 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