[f2fs-dev] 答复: 答复: [PATCH v4] f2fs: compress: avoid unnecessary check in f2fs_prepare_compress_overwrite

2021-05-12 Thread changfengnan
I agree with this plan, I will also test this patch also. Thanks -邮件原件- 发件人: Chao Yu 发送时间: 2021年5月12日 9:52 收件人: Jaegeuk Kim ; changfeng...@vivo.com 抄送: linux-f2fs-devel@lists.sourceforge.net 主题: Re: [f2fs-dev] 答复: [PATCH v4] f2fs: compress: avoid unnecessary check in f2fs_prepare_compr

[f2fs-dev] [PATCH] f2fs: return EINVAL for hole cases in swap file

2021-05-12 Thread Jaegeuk Kim
This tries to fix xfstests/generic/495. Signed-off-by: Jaegeuk Kim --- fs/f2fs/data.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 41e260680b27..009a09fb9d88 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -3896,7 +3896,7 @@ st

Re: [f2fs-dev] [PATCH 07/11] zonefs: Convert to using invalidate_lock

2021-05-12 Thread Damien Le Moal
On 2021/05/12 22:46, Jan Kara wrote: > Use invalidate_lock instead of zonefs' private i_mmap_sem. The intended > purpose is exactly the same. > > CC: Damien Le Moal > CC: Johannes Thumshirn > CC: > Signed-off-by: Jan Kara > --- > fs/zonefs/super.c | 23 +-- > fs/zonefs/zo

Re: [f2fs-dev] [GIT PULL][PATCH v11 0/4] Update to zstd-1.4.10

2021-05-12 Thread David Sterba
On Tue, May 11, 2021 at 08:53:41PM +, Nick Terrell wrote: > Pinging this series. Is there anything I should do to help get this > merged? > > The use of zstd in the kernel is continuously increasing over time, > both in terms of number of use cases, and number of users that > actually enable z

[f2fs-dev] [PATCH AUTOSEL 4.19 04/18] f2fs: fix to avoid out-of-bounds memory access

2021-05-12 Thread Sasha Levin
From: Chao Yu [ Upstream commit b862676e371715456c9dade7990c8004996d0d9e ] butt3rflyh4ck reported a bug found by syzkaller fuzzer with custom modifications in 5.12.0-rc3+ [1]: dump_stack+0xfa/0x151 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x82/0x32c mm/kasan/report.c:2

[f2fs-dev] [PATCH AUTOSEL 5.4 05/23] f2fs: fix to avoid out-of-bounds memory access

2021-05-12 Thread Sasha Levin
From: Chao Yu [ Upstream commit b862676e371715456c9dade7990c8004996d0d9e ] butt3rflyh4ck reported a bug found by syzkaller fuzzer with custom modifications in 5.12.0-rc3+ [1]: dump_stack+0xfa/0x151 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x82/0x32c mm/kasan/report.c:2

[f2fs-dev] [PATCH AUTOSEL 5.10 05/34] f2fs: fix to avoid out-of-bounds memory access

2021-05-12 Thread Sasha Levin
From: Chao Yu [ Upstream commit b862676e371715456c9dade7990c8004996d0d9e ] butt3rflyh4ck reported a bug found by syzkaller fuzzer with custom modifications in 5.12.0-rc3+ [1]: dump_stack+0xfa/0x151 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x82/0x32c mm/kasan/report.c:2

[f2fs-dev] [PATCH AUTOSEL 5.11 05/35] f2fs: fix to avoid out-of-bounds memory access

2021-05-12 Thread Sasha Levin
From: Chao Yu [ Upstream commit b862676e371715456c9dade7990c8004996d0d9e ] butt3rflyh4ck reported a bug found by syzkaller fuzzer with custom modifications in 5.12.0-rc3+ [1]: dump_stack+0xfa/0x151 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x82/0x32c mm/kasan/report.c:2

[f2fs-dev] [PATCH AUTOSEL 5.12 05/37] f2fs: fix to avoid out-of-bounds memory access

2021-05-12 Thread Sasha Levin
From: Chao Yu [ Upstream commit b862676e371715456c9dade7990c8004996d0d9e ] butt3rflyh4ck reported a bug found by syzkaller fuzzer with custom modifications in 5.12.0-rc3+ [1]: dump_stack+0xfa/0x151 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x82/0x32c mm/kasan/report.c:2

[f2fs-dev] [PATCH AUTOSEL 5.12 12/37] f2fs: fix to avoid NULL pointer dereference

2021-05-12 Thread Sasha Levin
From: Yi Chen [ Upstream commit 594b6d0428ae304e0b44457398beb458b938f005 ] Unable to handle kernel NULL pointer dereference at virtual address pc : f2fs_put_page+0x1c/0x26c lr : __revoke_inmem_pages+0x544/0x75c f2fs_put_page+0x1c/0x26c __revoke_inmem_pages+0x544/0x75c __f2fs_co

Re: [f2fs-dev] [PATCH 03/11] mm: Protect operations adding pages to page cache with invalidate_lock

2021-05-12 Thread Darrick J. Wong
On Wed, May 12, 2021 at 03:46:11PM +0200, Jan Kara wrote: > Currently, serializing operations such as page fault, read, or readahead > against hole punching is rather difficult. The basic race scheme is > like: > > fallocate(FALLOC_FL_PUNCH_HOLE) read / fault / .. > truncat

Re: [f2fs-dev] [PATCH 10/11] ceph: Fix race between hole punch and page fault

2021-05-12 Thread Jeff Layton
On Wed, 2021-05-12 at 15:46 +0200, Jan Kara wrote: > Ceph has a following race between hole punching and page fault: > > CPU1 CPU2 > ceph_fallocate() > ... > ceph_zero_pagecache_range() > ceph_filemap_fault() >

Re: [f2fs-dev] [PATCH v2 00/40] Use ASCII subset instead of UTF-8 alternate symbols

2021-05-12 Thread Mauro Carvalho Chehab
Em Wed, 12 May 2021 10:14:44 -0400 "Theodore Ts'o" escreveu: > On Wed, May 12, 2021 at 02:50:04PM +0200, Mauro Carvalho Chehab wrote: > > v2: > > - removed EM/EN DASH conversion from this patchset; > > Are you still thinking about doing the > > EN DASH --> "--" > EM DASH --> "---" > > conver

Re: [f2fs-dev] [PATCH 03/11] mm: Protect operations adding pages to page cache with invalidate_lock

2021-05-12 Thread Matthew Wilcox
On Wed, May 12, 2021 at 03:46:11PM +0200, Jan Kara wrote: > Currently, serializing operations such as page fault, read, or readahead > against hole punching is rather difficult. The basic race scheme is > like: > > fallocate(FALLOC_FL_PUNCH_HOLE) read / fault / .. > truncat

Re: [f2fs-dev] [PATCH 03/11] mm: Protect operations adding pages to page cache with invalidate_lock

2021-05-12 Thread Matthew Wilcox
On Wed, May 12, 2021 at 03:46:11PM +0200, Jan Kara wrote: > diff --git a/mm/truncate.c b/mm/truncate.c > index 57a618c4a0d6..93bde2741e0e 100644 > --- a/mm/truncate.c > +++ b/mm/truncate.c > @@ -415,7 +415,7 @@ EXPORT_SYMBOL(truncate_inode_pages_range); > * @mapping: mapping to truncate > * @l

Re: [f2fs-dev] [PATCH v2 00/40] Use ASCII subset instead of UTF-8 alternate symbols

2021-05-12 Thread Theodore Ts'o
On Wed, May 12, 2021 at 02:50:04PM +0200, Mauro Carvalho Chehab wrote: > v2: > - removed EM/EN DASH conversion from this patchset; Are you still thinking about doing the EN DASH --> "--" EM DASH --> "---" conversion? That's not going to change what the documentation will look like in the HTML a

[f2fs-dev] [PATCH 02/11] documentation: Sync file_operations members with reality

2021-05-12 Thread Jan Kara
Sync listing of struct file_operations members with the real one in fs.h. Signed-off-by: Jan Kara --- Documentation/filesystems/locking.rst | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Documentation/filesystems/locking.rst b/Documentation/filesystems/locki

[f2fs-dev] [PATCH 10/11] ceph: Fix race between hole punch and page fault

2021-05-12 Thread Jan Kara
Ceph has a following race between hole punching and page fault: CPU1 CPU2 ceph_fallocate() ... ceph_zero_pagecache_range() ceph_filemap_fault() faults in page in the range being

[f2fs-dev] [PATCH 01/11] mm: Fix comments mentioning i_mutex

2021-05-12 Thread Jan Kara
inode->i_mutex has been replaced with inode->i_rwsem long ago. Fix comments still mentioning i_mutex. Reviewed-by: Christoph Hellwig Acked-by: Hugh Dickins Signed-off-by: Jan Kara --- mm/filemap.c| 10 +- mm/madvise.c| 2 +- mm/memory-failure.c | 2 +- mm/rmap.c

[f2fs-dev] [PATCH 08/11] f2fs: Convert to using invalidate_lock

2021-05-12 Thread Jan Kara
Use invalidate_lock instead of f2fs' private i_mmap_sem. The intended purpose is exactly the same. By this conversion we fix a long standing race between hole punching and read(2) / readahead(2) paths that can lead to stale page cache contents. CC: Jaegeuk Kim CC: Chao Yu CC: linux-f2fs-devel@li

[f2fs-dev] [PATCH 11/11] cifs: Fix race between hole punch and page fault

2021-05-12 Thread Jan Kara
Cifs has a following race between hole punching and page fault: CPU1CPU2 smb3_fallocate() smb3_punch_hole() truncate_pagecache_range() filemap_fault()

[f2fs-dev] [PATCH 07/11] zonefs: Convert to using invalidate_lock

2021-05-12 Thread Jan Kara
Use invalidate_lock instead of zonefs' private i_mmap_sem. The intended purpose is exactly the same. CC: Damien Le Moal CC: Johannes Thumshirn CC: Signed-off-by: Jan Kara --- fs/zonefs/super.c | 23 +-- fs/zonefs/zonefs.h | 7 +++ 2 files changed, 8 insertions(+), 22

[f2fs-dev] [PATCH 06/11] xfs: Convert to use invalidate_lock

2021-05-12 Thread Jan Kara
Use invalidate_lock instead of XFS internal i_mmap_lock. The intended purpose of invalidate_lock is exactly the same. Note that the locking in __xfs_filemap_fault() slightly changes as filemap_fault() already takes invalidate_lock. Reviewed-by: Christoph Hellwig CC: CC: "Darrick J. Wong" Signed

[f2fs-dev] [PATCH 0/11 v5] fs: Hole punch vs page cache filling races

2021-05-12 Thread Jan Kara
Hello, here is another version of my patches to address races between hole punching and page cache filling functions for ext4 and other filesystems. The biggest change since the last time is update of the documentation to reflect the fact Dave Chinner spotted that some places also use this type of

[f2fs-dev] [PATCH 03/11] mm: Protect operations adding pages to page cache with invalidate_lock

2021-05-12 Thread Jan Kara
Currently, serializing operations such as page fault, read, or readahead against hole punching is rather difficult. The basic race scheme is like: fallocate(FALLOC_FL_PUNCH_HOLE) read / fault / .. truncate_inode_pages_range()

[f2fs-dev] [PATCH 04/11] ext4: Convert to use mapping->invalidate_lock

2021-05-12 Thread Jan Kara
Convert ext4 to use mapping->invalidate_lock instead of its private EXT4_I(inode)->i_mmap_sem. This is mostly search-and-replace. By this conversion we fix a long standing race between hole punching and read(2) / readahead(2) paths that can lead to stale page cache contents. CC: CC: Ted Tso Sign

[f2fs-dev] [PATCH 09/11] fuse: Convert to using invalidate_lock

2021-05-12 Thread Jan Kara
Use invalidate_lock instead of fuse's private i_mmap_sem. The intended purpose is exactly the same. By this conversion we fix a long standing race between hole punching and read(2) / readahead(2) paths that can lead to stale page cache contents. CC: Miklos Szeredi Signed-off-by: Jan Kara --- fs

[f2fs-dev] [PATCH 05/11] ext2: Convert to using invalidate_lock

2021-05-12 Thread Jan Kara
Ext2 has its private dax_sem used for synchronizing page faults and truncation. Use mapping->invalidate_lock instead as it is meant for this purpose. CC: Signed-off-by: Jan Kara --- fs/ext2/ext2.h | 11 --- fs/ext2/file.c | 7 +++ fs/ext2/inode.c | 12 ++-- fs/ext2/super.

[f2fs-dev] [PATCH v2 00/40] Use ASCII subset instead of UTF-8 alternate symbols

2021-05-12 Thread Mauro Carvalho Chehab
This series contain basically a cleanup from all those years of converting files to ReST. During the conversion period, several tools like LaTeX, pandoc, DocBook and some specially-written scripts were used in order to convert existing documents. Such conversion tools - plus some text editor like

[f2fs-dev] [PATCH v2 18/40] docs: filesystems: f2fs.rst: Use ASCII subset instead of UTF-8 alternate symbols

2021-05-12 Thread Mauro Carvalho Chehab
The conversion tools used during DocBook/LaTeX/Markdown->ReST conversion and some automatic rules which exists on certain text editors like LibreOffice turned ASCII characters into some UTF-8 alternatives that are better displayed on html and PDF. While it is OK to use UTF-8 characters in Linux, i

Re: [f2fs-dev] [PATCH v2] f2fs: avoid swapon failure by giving a warning first

2021-05-12 Thread Chao Yu
Jaegeuk, On 2021/5/12 12:00, Jaegeuk Kim wrote: The final solution can be migrating blocks to form a section-aligned file internally. Meanwhile, let's ask users to do that when preparing the swap file initially like: 1) create() 2) ioctl(F2FS_IOC_SET_PIN_FILE) 3) fallocate() Reported-by: kernel

[f2fs-dev] [PATCH RFC] f2fs: support migrating swapfile in aligned write mode

2021-05-12 Thread Chao Yu
Signed-off-by: Chao Yu --- *do not merge this patch*, I haven't tested this patch yet, just send this out for comments. fs/f2fs/data.c| 117 +- fs/f2fs/f2fs.h| 1 + fs/f2fs/node.h| 3 ++ fs/f2fs/segment.c | 3 ++ 4 files changed, 92

[f2fs-dev] [PATCH 1/3] f2fs: compress: remove unneeded f2fs_put_dnode()

2021-05-12 Thread Chao Yu
If we don't initialize dn.inode_page for f2fs_get_block(), f2fs_get_block() will call f2fs_put_dnode() itself, so let's remove unneeded f2fs_put_dnode() in f2fs_vm_page_mkwrite(). Signed-off-by: Chao Yu --- fs/f2fs/file.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/f2fs/file.c b/fs/f2f

[f2fs-dev] [PATCH 2/3] f2fs: compress: clean up parameter of __f2fs_cluster_blocks()

2021-05-12 Thread Chao Yu
Previously, in order to reuse __f2fs_cluster_blocks(), f2fs_is_compressed_cluster() assigned a compress_ctx type variable, which is used to pass few parameters (cc.inode, cc.cluster_size, cc.cluster_idx), it's wasteful to allocate such large space in stack. Let's clean up parameters of __f2fs_clus

[f2fs-dev] [PATCH 3/3] f2fs: compress: remove unneeded preallocation

2021-05-12 Thread Chao Yu
We will reserve iblocks for compression saved, so during compressed cluster overwrite, we don't need to preallocate blocks for later write. In addition, it adds a bug_on to detect wrong reserved iblock number in __f2fs_cluster_blocks(). Signed-off-by: Chao Yu --- fs/f2fs/compress.c | 26 ++-

[f2fs-dev] [PATCH] f2fs: support cold file defragementation

2021-05-12 Thread Daejun Park
F2FS_IOC_DEFRAGMENT performs defragmentation of a file. In f2fs_defragment_range(), it checks whether in-place update policy is applied, for avoiding unnecessary write operations. The cold file may be fragmented according to the write order. However, in the case of a cold file, the in-place update

[f2fs-dev] [PATCH v2] tools: Introduce f2fslabel

2021-05-12 Thread Dongwoo Lee
Although many other filesystems provide a tool for changing volume label, e.g. e2label for ext filesystem, but f2fs has no way to change volume label except set it while formatting with mkfs.f2fs. This introduces f2fslabel, simple tool for changing label of f2fs volume. Signed-off-by: Dongwoo Lee

Re: [f2fs-dev] [PATCH] f2fs: set file as cold when file defragmentation

2021-05-12 Thread Daejun Park
>On 05/11, Chao Yu wrote: >> On 2021/5/11 14:41, Daejun Park wrote: >> > > On 2021/5/11 13:09, Jaegeuk Kim wrote: >> > > > On 05/11, Chao Yu wrote: >> > > > > On 2021/5/10 22:47, Jaegeuk Kim wrote: >> > > > > > On 05/06, Chao Yu wrote: >> > > > > > > On 2021/5/6 12:46, Jaegeuk Kim wrote: >> > > > >