[f2fs-dev] [PATCH v3 3/4] f2fs: fix NULL pointer dereference in f2fs_verity_work()

2020-03-23 Thread Chao Yu
If both compression and fsverity feature is on, generic/572 will report below NULL pointer dereference bug. BUG: kernel NULL pointer dereference, address: 0018 RIP: 0010:f2fs_verity_work+0x60/0x90 [f2fs] #PF: supervisor read access in kernel mode Workqueue: fsverity_read_queue

[f2fs-dev] [PATCH v4] fsck.f2fs: allow fsck to fix issues with online resize due to SPO

2020-03-23 Thread Sahitya Tummala
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 user_block_count(2233856) [f2fs_do_mount:3365]

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

2020-03-23 Thread Joe Perches
On Mon, 2020-03-23 at 11:18 +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-23 Thread Sahitya Tummala
On Mon, Mar 23, 2020 at 09:54:20AM +0800, Chao Yu wrote: > 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

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

2020-03-23 Thread John
On Mon, Mar 23, 2020 at 12:11 AM Jaegeuk Kim wrote: > > 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

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

2020-03-23 Thread Jaegeuk Kim
On 03/23, John wrote: > On Mon, Mar 23, 2020 at 12:11 AM Jaegeuk Kim wrote: > > > > 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

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

2020-03-23 Thread Jaegeuk Kim
On 03/23, Joe Perches wrote: > On Mon, 2020-03-23 at 11:18 +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

Re: [f2fs-dev] [PATCH 2/2] writeback, xfs: call dirty_inode() with I_DIRTY_TIME_EXPIRED when appropriate

2020-03-23 Thread Theodore Y. Ts'o
Christoph, Dave --- does this give you the notification that you were looking such that XFS could get the notification desired that it was the timestamps need to be written back? - Ted On Thu, Mar 19, 2020 at 10:52:55PM -0400, Theodore Ts'o wrote: > Use the flag

[f2fs-dev] [PATCH v10 15/25] mm: Use memalloc_nofs_save in readahead path

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Ensure that memory allocations in the readahead path do not attempt to reclaim file-backed pages, which could lead to a deadlock. It is possible, though unlikely this is the root cause of a problem observed by Cong Wang. Signed-off-by: Matthew Wilcox (Oracle)

[f2fs-dev] [PATCH v10 25/25] iomap: Convert from readpages to readahead

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in iomap. Convert XFS and ZoneFS to use it. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Reviewed-by: William Kucharski --- fs/iomap/buffered-io.c | 90

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

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" By reducing nr_to_read, we can eliminate this check from inside the loop. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: John Hubbard Reviewed-by: William Kucharski --- mm/readahead.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-)

[f2fs-dev] [PATCH v10 06/25] mm: Use readahead_control to pass arguments

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" In this patch, only between __do_page_cache_readahead() and read_pages(), but it will be extended in upcoming patches. The read_pages() function becomes aops centric, as this makes the most sense by the end of the patchset. Signed-off-by: Matthew Wilcox (Oracle)

[f2fs-dev] [PATCH v10 05/25] mm: Add new readahead_control API

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Filesystems which implement the upcoming ->readahead method will get their pages by calling readahead_page() or readahead_page_batch(). These functions support large pages, even though none of the filesystems to be converted do yet. Signed-off-by: Matthew Wilcox

[f2fs-dev] [PATCH v10 14/25] mm: Document why we don't set PageReadahead

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" If the page is already in cache, we don't set PageReadahead on it. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski --- mm/readahead.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff

[f2fs-dev] [PATCH v10 01/25] mm: Move readahead prototypes from mm.h

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" The readahead code is part of the page cache so should be found in the pagemap.h file. force_page_cache_readahead is only used within mm, so move it to mm/internal.h instead. Remove the parameter names where they add no value, and rename the ones which were

[f2fs-dev] [PATCH v10 04/25] mm: Move readahead nr_pages check into read_pages

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Simplify the callers by moving the check for nr_pages and the BUG_ON into read_pages(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Zi Yan Reviewed-by: John Hubbard Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski --- mm/readahead.c |

[f2fs-dev] [PATCH v10 02/25] mm: Return void from various readahead functions

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" ondemand_readahead has two callers, neither of which use the return value. That means that both ra_submit and __do_page_cache_readahead() can return void, and we don't need to worry that a present page in the readahead window causes us to return a smaller nr_pages

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

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in f2fs Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: William Kucharski Reviewed-by: Eric Biggers Reviewed-by: Chao Yu Acked-by: Jaegeuk Kim --- fs/f2fs/data.c | 47 +++--

[f2fs-dev] [PATCH v10 21/25] ext4: Pass the inode to ext4_mpage_readpages

2020-03-23 Thread Matthew Wilcox
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: William Kucharski Reviewed-by: Eric Biggers ---

[f2fs-dev] [PATCH v10 20/25] ext4: Convert from readpages to readahead

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in ext4 Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: William Kucharski Reviewed-by: Eric Biggers --- fs/ext4/ext4.h | 3 +-- fs/ext4/inode.c| 21 + fs/ext4/readpage.c | 22

[f2fs-dev] [PATCH v10 03/25] mm: Ignore return value of ->readpages

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" We used to assign the return value to a variable, which we then ignored. Remove the pretence of caring. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Dave Chinner Reviewed-by: John Hubbard Reviewed-by: William Kucharski

[f2fs-dev] [PATCH v10 07/25] mm: Rename various 'offset' parameters to 'index'

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" The word 'offset' is used ambiguously to mean 'byte offset within a page', 'byte offset from the start of the file' and 'page offset from the start of the file'. Use 'index' to mean 'page offset from the start of the file' throughout the readahead code.

[f2fs-dev] [PATCH v10 08/25] mm: rename readahead loop variable to 'i'

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Change the type of page_idx to unsigned long, and rename it -- it's just a loop counter, not a page index. Suggested-by: John Hubbard Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Dave Chinner Reviewed-by: William Kucharski --- mm/readahead.c | 8

[f2fs-dev] [PATCH v10 11/25] mm: Add readahead address space operation

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" This replaces ->readpages with a saner interface: - Return void instead of an ignored error code. - Page cache is already populated with locked pages when ->readahead is called. - New arguments can be passed to the implementation without changing all the

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

2020-03-23 Thread Matthew Wilcox
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: William Kucharski Reviewed-by: Eric Biggers

[f2fs-dev] [PATCH v10 00/25] Change readahead API

2020-03-23 Thread Matthew Wilcox
d remain flaky afterwards). This series can also be found at http://git.infradead.org/users/willy/linux-dax.git/shortlog/refs/tags/readahead_v10 v10: Rebased on linux-next 20200323 - Collected some more reviewed-by tags - Simplify nr_to_read limits (Eric Biggers) - Convert fs/exfat instead of drivers

[f2fs-dev] [PATCH v10 24/25] fuse: Convert from readpages to readahead

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in fuse. Switching away from the read_cache_pages() helper gets rid of an implicit call to put_page(), so we can get rid of the get_page() call in fuse_readpages_fill(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Dave

[f2fs-dev] [PATCH v10 09/25] mm: Remove 'page_offset' from readahead loop

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Replace the page_offset variable with 'index + i'. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: John Hubbard Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski --- mm/readahead.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-)

[f2fs-dev] [PATCH v10 16/25] fs: Convert mpage_readpages to mpage_readahead

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Implement the new readahead aop and convert all callers (block_dev, exfat, ext2, fat, gfs2, hpfs, isofs, jfs, nilfs2, ocfs2, omfs, qnx6, reiserfs & udf). The callers are all trivial except for GFS2 & OCFS2. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by:

[f2fs-dev] [PATCH v10 13/25] mm: Add page_cache_readahead_unbounded

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" ext4 and f2fs have duplicated the guts of the readahead code so they can read past i_size. Instead, separate out the guts of the readahead code so they can call it directly. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by:

[f2fs-dev] [PATCH v10 18/25] erofs: Convert uncompressed files from readpages to readahead

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in erofs Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Gao Xiang Reviewed-by: William Kucharski Reviewed-by: Chao Yu --- fs/erofs/data.c | 39 +--- fs/erofs/zdata.c |

[f2fs-dev] [PATCH v10 17/25] btrfs: Convert from readpages to readahead

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Implement the new readahead method in btrfs using the new readahead_page_batch() function. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: William Kucharski --- fs/btrfs/extent_io.c | 43 --- fs/btrfs/extent_io.h |

[f2fs-dev] [PATCH v10 10/25] mm: Put readahead pages in cache earlier

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" When populating the page cache for readahead, mappings that use ->readpages must populate the page cache themselves as the pages are passed on a linked list which would normally be used for the page cache's LRU. For mappings that use ->readpage or the upcoming

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

2020-03-23 Thread Eric Biggers
On Mon, Mar 23, 2020 at 01:22:46PM -0700, Matthew Wilcox wrote: > From: "Matthew Wilcox (Oracle)" > > By reducing nr_to_read, we can eliminate this check from inside the loop. > > Signed-off-by: Matthew Wilcox (Oracle) > Reviewed-by: John Hubbard > Reviewed-by: William Kucharski > --- >

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

2020-03-23 Thread John
On Mon, Mar 23, 2020 at 11:02 AM Jaegeuk Kim wrote: > > /dev/mapper/media-crypt /mnt/media f2fs > > rw,lazytime,relatime,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,alloc_mode=default,fsync_mode=posix

[f2fs-dev] [PATCH v10 19/25] erofs: Convert compressed files from readpages to readahead

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in erofs. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Gao Xiang Reviewed-by: Dave Chinner Reviewed-by: William Kucharski Reviewed-by: Chao Yu --- fs/erofs/zdata.c | 29 + 1 file changed, 9

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

2020-03-23 Thread Chao Yu
On 2020/3/24 4:12, John wrote: > On Mon, Mar 23, 2020 at 11:02 AM Jaegeuk Kim wrote: >>> /dev/mapper/media-crypt /mnt/media f2fs >>>