[f2fs-dev] 答复: [PATCH -next] f2fs: add flush_dcache_page after page was written

2022-09-12 Thread zhangqilong via Linux-f2fs-devel
> > On 2022/8/25 10:41, Zhang Qilong wrote: > > If the written page was mapped more than twice, the written data here > > will not be seen by others. We add the flush_dcache_page to fix it. > > > > Fixes:0a2aa8fbb9693 ("f2fs: refactor __exchange_data_block for speed > > up") > > Signed-off-by:

Re: [f2fs-dev] [PATCH] f2fs: fix to detect obsolete inner inode during fill_super()

2022-09-12 Thread Jaegeuk Kim
On 09/08, Chao Yu wrote: > Sometimes we can get a cached meta_inode which has no aops yet. Let's set it > all the time to fix the below panic. > > Unable to handle kernel NULL pointer dereference at virtual address > > Mem abort info: > ESR = 0x8604 > EC = 0x21:

[f2fs-dev] [PATCH v2 22/23] nilfs2: Convert nilfs_clear_dirty_pages() to use filemap_get_folios_tag()

2022-09-12 Thread Vishal Moola (Oracle)
Convert function to use folios throughout. This is in preparation for the removal of find_get_pages_range_tag(). Signed-off-by: Vishal Moola (Oracle) Acked-by: Ryusuke Konishi --- fs/nilfs2/page.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git

[f2fs-dev] [PATCH v2 05/23] afs: Convert afs_writepages_region() to use filemap_get_folios_tag()

2022-09-12 Thread Vishal Moola (Oracle)
Convert to use folios throughout. This function is in preparation to remove find_get_pages_range_tag(). Also modified this function to write the whole batch one at a time, rather than calling for a new set every single write. Signed-off-by: Vishal Moola (Oracle) --- fs/afs/write.c | 114

[f2fs-dev] [PATCH v2 06/23] btrfs: Convert btree_write_cache_pages() to use filemap_get_folio_tag()

2022-09-12 Thread Vishal Moola (Oracle)
Converted function to use folios throughout. This is in preparation for the removal of find_get_pages_range_tag(). Signed-off-by: Vishal Moola (Oracle) Acked-by: David Sterba --- fs/btrfs/extent_io.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git

[f2fs-dev] [PATCH v2 08/23] ceph: Convert ceph_writepages_start() to use filemap_get_folios_tag()

2022-09-12 Thread Vishal Moola (Oracle)
Convert function to use folios throughout. This is in preparation for the removal of find_get_pages_range_tag(). This change does NOT support large folios. This shouldn't be an issue as of now since ceph only utilizes folios of size 1 anyways, and there is a lot of work to be done on ceph

[f2fs-dev] [PATCH v2 02/23] filemap: Added filemap_get_folios_tag()

2022-09-12 Thread Vishal Moola (Oracle)
This is the equivalent of find_get_pages_range_tag(), except for folios instead of pages. One noteable difference is filemap_get_folios_tag() does not take in a maximum pages argument. It instead tries to fill a folio batch and stops either once full (15 folios) or reaching the end of the search

[f2fs-dev] [PATCH v2 13/23] f2fs: Convert f2fs_sync_node_pages() to use filemap_get_folios_tag()

2022-09-12 Thread Vishal Moola (Oracle)
Convert function to use folios. This is in preparation for the removal of find_get_pages_range_tag(). Does NOT support large folios. Signed-off-by: Vishal Moola (Oracle) --- fs/f2fs/node.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/fs/f2fs/node.c

[f2fs-dev] [PATCH v2 11/23] f2fs: Convert f2fs_fsync_node_pages() to use filemap_get_folios_tag()

2022-09-12 Thread Vishal Moola (Oracle)
Convert function to use folios. This is in preparation for the removal of find_get_pages_range_tag(). Does NOT support large folios. Signed-off-by: Vishal Moola (Oracle) --- fs/f2fs/node.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/fs/f2fs/node.c

[f2fs-dev] [PATCH v2 10/23] ext4: Convert mpage_prepare_extent_to_map() to use filemap_get_folios_tag()

2022-09-12 Thread Vishal Moola (Oracle)
Converted the function to use folios throughout. This is in preparation for the removal of find_get_pages_range_tag(). Now supports large folios. Signed-off-by: Vishal Moola (Oracle) --- fs/ext4/inode.c | 55 - 1 file changed, 27 insertions(+), 28

[f2fs-dev] [PATCH v2 17/23] gfs2: Convert gfs2_write_cache_jdata() to use filemap_get_folios_tag()

2022-09-12 Thread Vishal Moola (Oracle)
Converted function to use folios throughout. This is in preparation for the removal of find_get_pgaes_range_tag(). Also had to modify and rename gfs2_write_jdata_pagevec() to take in and utilize folio_batch rather than pagevec and use folios rather than pages. gfs2_write_jdata_batch() now

[f2fs-dev] [PATCH v2 14/23] f2fs: Convert f2fs_write_cache_pages() to use filemap_get_folios_tag()

2022-09-12 Thread Vishal Moola (Oracle)
Converted the function to use folios. This is in preparation for the removal of find_get_pages_range_tag(). Also modified f2fs_all_cluster_page_ready to take in a folio_batch instead of pagevec. This does NOT support large folios. The function currently only utilizes folios of size 1 so this

[f2fs-dev] [PATCH v2 16/23] f2fs: Convert f2fs_sync_meta_pages() to use filemap_get_folios_tag()

2022-09-12 Thread Vishal Moola (Oracle)
Convert function to use folios. This is in preparation for the removal of find_get_pages_range_tag(). Initially the function was checking if the previous page index is truly the previous page i.e. 1 index behind the current page. To convert to folios and maintain this check we need to make the

[f2fs-dev] [PATCH v2 19/23] nilfs2: Convert nilfs_lookup_dirty_node_buffers() to use filemap_get_folios_tag()

2022-09-12 Thread Vishal Moola (Oracle)
Convert function to use folios throughout. This is in preparation for the removal of find_get_pages_range_tag(). Signed-off-by: Vishal Moola (Oracle) Acked-by: Ryusuke Konishi --- fs/nilfs2/segment.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git

[f2fs-dev] [PATCH v2 15/23] f2fs: Convert last_fsync_dnode() to use filemap_get_folios_tag()

2022-09-12 Thread Vishal Moola (Oracle)
Convert to use folios. This is in preparation for the removal of find_get_pages_range_tag(). Signed-off-by: Vishal Moola (Oracle) --- fs/f2fs/node.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index

[f2fs-dev] [PATCH v2 12/23] f2fs: Convert f2fs_flush_inline_data() to use filemap_get_folios_tag()

2022-09-12 Thread Vishal Moola (Oracle)
Convert function to use folios. This is in preparation for the removal of find_get_pages_tag(). Does NOT support large folios. Signed-off-by: Vishal Moola (Oracle) --- fs/f2fs/node.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/fs/f2fs/node.c

[f2fs-dev] [PATCH v2 09/23] cifs: Convert wdata_alloc_and_fillpages() to use filemap_get_folios_tag()

2022-09-12 Thread Vishal Moola (Oracle)
Convert function to use folios. This is in preparation for the removal of find_get_pages_range_tag(). Now also supports the use of large folios. Since tofind might be larger than the max number of folios in a folio_batch (15), we loop through filling in wdata->pages pulling more batches until we

[f2fs-dev] [PATCH v2 18/23] nilfs2: Convert nilfs_lookup_dirty_data_buffers() to use filemap_get_folios_tag()

2022-09-12 Thread Vishal Moola (Oracle)
Convert function to use folios throughout. This is in preparation for the removal of find_get_pages_range_tag(). Signed-off-by: Vishal Moola (Oracle) --- fs/nilfs2/segment.c | 29 - 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/fs/nilfs2/segment.c

[f2fs-dev] [PATCH v2 23/23] filemap: Remove find_get_pages_range_tag()

2022-09-12 Thread Vishal Moola (Oracle)
All callers to find_get_pages_range_tag(), find_get_pages_tag(), pagevec_lookup_range_tag(), and pagevec_lookup_tag() have been removed. Signed-off-by: Vishal Moola (Oracle) --- include/linux/pagemap.h | 10 --- include/linux/pagevec.h | 8 -- mm/filemap.c| 60

[f2fs-dev] [PATCH v2 00/23] Convert to filemap_get_folios_tag()

2022-09-12 Thread Vishal Moola (Oracle)
This patch series replaces find_get_pages_range_tag() with filemap_get_folios_tag(). This also allows the removal of multiple calls to compound_head() throughout. It also makes a good chunk of the straightforward conversions to folios, and takes the opportunity to introduce a function that grabs a

[f2fs-dev] [PATCH v2 21/23] nilfs2: Convert nilfs_copy_dirty_pages() to use filemap_get_folios_tag()

2022-09-12 Thread Vishal Moola (Oracle)
Convert function to use folios throughout. This is in preparation for the removal of find_get_pages_range_tag(). Signed-off-by: Vishal Moola (Oracle) Acked-by: Ryusuke Konishi --- fs/nilfs2/page.c | 39 --- 1 file changed, 20 insertions(+), 19 deletions(-)

[f2fs-dev] [PATCH v2 20/23] nilfs2: Convert nilfs_btree_lookup_dirty_buffers() to use filemap_get_folios_tag()

2022-09-12 Thread Vishal Moola (Oracle)
Convert function to use folios throughout. This is in preparation for the removal of find_get_pages_range_tag(). Signed-off-by: Vishal Moola (Oracle) Acked-by: Ryusuke Konishi --- fs/nilfs2/btree.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git

[f2fs-dev] [PATCH v2 04/23] page-writeback: Convert write_cache_pages() to use filemap_get_folios_tag()

2022-09-12 Thread Vishal Moola (Oracle)
Converted function to use folios throughout. This is in preparation for the removal of find_get_pages_range_tag(). Signed-off-by: Vishal Moola (Oracle) --- mm/page-writeback.c | 44 +++- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git

[f2fs-dev] [PATCH v2 03/23] filemap: Convert __filemap_fdatawait_range() to use filemap_get_folios_tag()

2022-09-12 Thread Vishal Moola (Oracle)
Converted function to use folios. This is in preparation for the removal of find_get_pages_range_tag(). Signed-off-by: Vishal Moola (Oracle) --- mm/filemap.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/mm/filemap.c b/mm/filemap.c index

[f2fs-dev] [PATCH v2 07/23] btrfs: Convert extent_write_cache_pages() to use filemap_get_folios_tag()

2022-09-12 Thread Vishal Moola (Oracle)
Converted function to use folios throughout. This is in preparation for the removal of find_get_pages_range_tag(). Now also supports large folios. Signed-off-by: Vishal Moola (Oracle) Acked-by: David Sterba --- fs/btrfs/extent_io.c | 38 +++--- 1 file changed,

[f2fs-dev] [PATCH v2 01/23] pagemap: Add filemap_grab_folio()

2022-09-12 Thread Vishal Moola (Oracle)
Add function filemap_grab_folio() to grab a folio from the page cache. This function is meant to serve as a folio replacement for grab_cache_page, and is used to facilitate the removal of find_get_pages_range_tag(). Signed-off-by: Vishal Moola (Oracle) --- include/linux/pagemap.h | 20

Re: [f2fs-dev] [PATCH v2] f2fs: fix to disallow getting inner inode via f2fs_iget()

2022-09-12 Thread Jaegeuk Kim
On 09/08, Chao Yu wrote: > On 2022/9/8 10:19, Jaegeuk Kim wrote: > > On 09/08, Chao Yu wrote: > > > On 2022/9/8 10:02, Jaegeuk Kim wrote: > > > > On 08/31, Chao Yu wrote: > > > > > From: Chao Yu > > > > > > > > > > Introduce f2fs_iget_inner() for f2fs_fill_super() to get inner inode: > > > > >

Re: [f2fs-dev] [PATCH v2 18/23] nilfs2: Convert nilfs_lookup_dirty_data_buffers() to use filemap_get_folios_tag()

2022-09-12 Thread Ryusuke Konishi
On Tue, Sep 13, 2022 at 3:30 AM Vishal Moola (Oracle) wrote: > > Convert function to use folios throughout. This is in preparation for > the removal of find_get_pages_range_tag(). > > Signed-off-by: Vishal Moola (Oracle) > --- > fs/nilfs2/segment.c | 29 - > 1 file

Re: [f2fs-dev] [PATCH v2] f2fs: fix to disallow getting inner inode via f2fs_iget()

2022-09-12 Thread Chao Yu
On 2022/9/12 23:39, Jaegeuk Kim wrote: On 09/08, Chao Yu wrote: On 2022/9/8 10:19, Jaegeuk Kim wrote: On 09/08, Chao Yu wrote: On 2022/9/8 10:02, Jaegeuk Kim wrote: On 08/31, Chao Yu wrote: From: Chao Yu Introduce f2fs_iget_inner() for f2fs_fill_super() to get inner inode: meta inode,

[f2fs-dev] [PATCH v2] f2fs: fix to do sanity check on destination blkaddr during recovery

2022-09-12 Thread Chao Yu
As Wenqing Liu reported in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=216456 loop5: detected capacity change from 0 to 131072 F2FS-fs (loop5): recover_inode: ino = 6, name = hln, inline = 1 F2FS-fs (loop5): recover_data: ino = 6 (i_size: recover) err = 0 F2FS-fs (loop5):

[f2fs-dev] [PATCH] f2fs: fix to do sanity check on summary info

2022-09-12 Thread Chao Yu
As Wenqing Liu reported in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=216456 BUG: KASAN: use-after-free in recover_data+0x63ae/0x6ae0 [f2fs] Read of size 4 at addr 8881464dcd80 by task mount/1013 CPU: 3 PID: 1013 Comm: mount Tainted: GW 6.0.0-rc4 #1 Hardware

Re: [f2fs-dev] [PATCH -next] f2fs: adding truncate page cache after being moved

2022-09-12 Thread Chao Yu
On 2022/9/13 11:05, Zhang Qilong wrote: If we do not truncate source page cache, user can still see the previous source data after being moved. We fix it by adding truncating after __exchange_data_block. Fixes:4dd6f977fc778 ("f2fs: support an ioctl to move a range of data blocks")

[f2fs-dev] 答复: 答复: [PATCH -next] f2fs: adding truncate page cache after being moved

2022-09-12 Thread zhangqilong via Linux-f2fs-devel
> > On 2022/9/13 11:41, zhangqilong wrote: > >> On 2022/9/13 11:05, Zhang Qilong wrote: > >>> If we do not truncate source page cache, user can still see the > >>> previous source data after being moved. We fix it by adding > >>> truncating after __exchange_data_block. > >>> > >>>

Re: [f2fs-dev] [PATCH 1/2] f2fs: flush pending checkpoints when freezing super

2022-09-12 Thread Chao Yu
On 2022/8/25 4:02, Jaegeuk Kim wrote: This avoids -EINVAL when trying to freeze f2fs. Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net

Re: [f2fs-dev] [PATCH 2/2 v2] f2fs: complete checkpoints during remount

2022-09-12 Thread Chao Yu
On 2022/8/25 4:30, Jaegeuk Kim wrote: Otherwise, pending checkpoints can contribute a race condition to give a quota warning. - Thread - checkpoint thread add checkpoints to the list do_remount() down_write(>s_umount); f2fs_remount()

[f2fs-dev] 答复: [PATCH -next] f2fs: adding truncate page cache after being moved

2022-09-12 Thread zhangqilong via Linux-f2fs-devel
> On 2022/9/13 11:05, Zhang Qilong wrote: > > If we do not truncate source page cache, user can still see the > > previous source data after being moved. We fix it by adding truncating > > after __exchange_data_block. > > > > Fixes:4dd6f977fc778 ("f2fs: support an ioctl to move a range of data > >

Re: [f2fs-dev] 答复: [PATCH -next] f2fs: adding truncate page cache after being moved

2022-09-12 Thread Chao Yu
On 2022/9/13 11:41, zhangqilong wrote: On 2022/9/13 11:05, Zhang Qilong wrote: If we do not truncate source page cache, user can still see the previous source data after being moved. We fix it by adding truncating after __exchange_data_block. Fixes:4dd6f977fc778 ("f2fs: support an ioctl to

Re: [f2fs-dev] [PATCH v2] f2fs: fix to disallow getting inner inode via f2fs_iget()

2022-09-12 Thread Jaegeuk Kim
On 09/13, Chao Yu wrote: > On 2022/9/12 23:39, Jaegeuk Kim wrote: > > On 09/08, Chao Yu wrote: > > > On 2022/9/8 10:19, Jaegeuk Kim wrote: > > > > On 09/08, Chao Yu wrote: > > > > > On 2022/9/8 10:02, Jaegeuk Kim wrote: > > > > > > On 08/31, Chao Yu wrote: > > > > > > > From: Chao Yu > > > > > >

[f2fs-dev] [PATCH -next] f2fs: adding truncate page cache after being moved

2022-09-12 Thread Zhang Qilong via Linux-f2fs-devel
If we do not truncate source page cache, user can still see the previous source data after being moved. We fix it by adding truncating after __exchange_data_block. Fixes:4dd6f977fc778 ("f2fs: support an ioctl to move a range of data blocks") Signed-off-by: Zhang Qilong --- fs/f2fs/file.c | 4

Re: [f2fs-dev] [PATCH] f2fs: increase the limit for reserve_root

2022-09-12 Thread Chao Yu
On 2022/8/24 1:21, Jaegeuk Kim wrote: This patch increases the threshold that limits the reserved root space from 0.2% to 12.5% by using simple shift operation. Typically Android sets 128MB, but if the storage capacity is 32GB, 0.2% which is around 64MB becomes too small. Let's relax it.

Re: [f2fs-dev] [PATCH] f2fs: fix to detect obsolete inner inode during fill_super()

2022-09-12 Thread Chao Yu
On 2022/9/12 23:37, Jaegeuk Kim wrote: On 09/08, Chao Yu wrote: Sometimes we can get a cached meta_inode which has no aops yet. Let's set it all the time to fix the below panic. Unable to handle kernel NULL pointer dereference at virtual address Mem abort info: ESR =