[f2fs-dev] [syzbot] [f2fs?] [tmpfs?] kernel BUG in f2fs_evict_inode

2022-12-21 Thread syzbot
Hello,

syzbot found the following issue on:

HEAD commit:77856d911a8c Merge tag 'arm64-fixes' of git://git.kernel.o..
git tree:   upstream
console+strace: https://syzkaller.appspot.com/x/log.txt?x=17c418c848
kernel config:  https://syzkaller.appspot.com/x/.config?x=f967143badd2fa39
dashboard link: https://syzkaller.appspot.com/bug?extid=e1246909d526a9d470fa
compiler:   Debian clang version 
13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU 
Binutils for Debian) 2.35.2
syz repro:  https://syzkaller.appspot.com/x/repro.syz?x=160ea04f88
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=17e2a99d88

Downloadable assets:
disk image: 
https://storage.googleapis.com/syzbot-assets/4b424d9203f5/disk-77856d91.raw.xz
vmlinux: 
https://storage.googleapis.com/syzbot-assets/47fd68051834/vmlinux-77856d91.xz
kernel image: 
https://storage.googleapis.com/syzbot-assets/d3091f087a86/bzImage-77856d91.xz
mounted in repro: 
https://storage.googleapis.com/syzbot-assets/36b1377afaef/mount_0.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+e1246909d526a9d47...@syzkaller.appspotmail.com

[ cut here ]
kernel BUG at fs/f2fs/inode.c:864!
invalid opcode:  [#1] PREEMPT SMP KASAN
CPU: 1 PID: 5067 Comm: syz-executor118 Not tainted 
6.1.0-syzkaller-13031-g77856d911a8c #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 
10/26/2022
RIP: 0010:f2fs_evict_inode+0x1306/0x1310 fs/f2fs/inode.c:864
Code: ff 89 d9 80 e1 07 80 c1 03 38 c1 0f 8c 8a f5 ff ff 48 89 df e8 4b 51 1a 
fe e9 7d f5 ff ff e8 e1 b4 c4 fd 0f 0b e8 da b4 c4 fd <0f> 0b 0f 1f 84 00 00 00 
00 00 55 41 57 41 56 53 48 89 fb e8 c2 b4
RSP: 0018:c90003b3f8f8 EFLAGS: 00010293
RAX: 83c720e6 RBX: 0002 RCX: 8880251257c0
RDX:  RSI: 0002 RDI: 
RBP:  R08: 83c71bc3 R09: ed100e5a41b5
R10: ed100e5a41b5 R11: 11100e5a41b4 R12: dc00
R13: 888072d208f0 R14: 888072d20da0 R15: 
FS:  5685a300() GS:8880b990() knlGS:
CS:  0010 DS:  ES:  CR0: 80050033
CR2: 7ffd85832d68 CR3: 726a5000 CR4: 003506e0
DR0:  DR1:  DR2: 
DR3:  DR6: fffe0ff0 DR7: 0400
Call Trace:
 
 evict+0x2a4/0x620 fs/inode.c:664
 dispose_list fs/inode.c:697 [inline]
 evict_inodes+0x658/0x700 fs/inode.c:747
 generic_shutdown_super+0x94/0x310 fs/super.c:480
 kill_block_super+0x79/0xd0 fs/super.c:1386
 kill_f2fs_super+0x2f9/0x3c0 fs/f2fs/super.c:4640
 deactivate_locked_super+0xa7/0xf0 fs/super.c:332
 cleanup_mnt+0x494/0x520 fs/namespace.c:1291
 task_work_run+0x243/0x300 kernel/task_work.c:179
 ptrace_notify+0x29a/0x340 kernel/signal.c:2354
 ptrace_report_syscall include/linux/ptrace.h:411 [inline]
 ptrace_report_syscall_exit include/linux/ptrace.h:473 [inline]
 syscall_exit_work+0x8c/0xe0 kernel/entry/common.c:251
 syscall_exit_to_user_mode_prepare+0x63/0xc0 kernel/entry/common.c:278
 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline]
 syscall_exit_to_user_mode+0xa/0x60 kernel/entry/common.c:296
 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fd8e1d06d97
Code: 08 00 48 83 c4 08 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 c3 66 2e 0f 1f 
84 00 00 00 00 00 0f 1f 44 00 00 b8 a6 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 
c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:7ffd858334a8 EFLAGS: 0202 ORIG_RAX: 00a6
RAX:  RBX:  RCX: 7fd8e1d06d97
RDX: 7ffd85833569 RSI: 000a RDI: 7ffd85833560
RBP: 7ffd85833560 R08:  R09: 7ffd85833340
R10: 5685b653 R11: 0202 R12: 7ffd858345d0
R13: 5685b5f0 R14: 7ffd858334d0 R15: 0001
 
Modules linked in:
---[ end trace  ]---
RIP: 0010:f2fs_evict_inode+0x1306/0x1310 fs/f2fs/inode.c:864
Code: ff 89 d9 80 e1 07 80 c1 03 38 c1 0f 8c 8a f5 ff ff 48 89 df e8 4b 51 1a 
fe e9 7d f5 ff ff e8 e1 b4 c4 fd 0f 0b e8 da b4 c4 fd <0f> 0b 0f 1f 84 00 00 00 
00 00 55 41 57 41 56 53 48 89 fb e8 c2 b4
RSP: 0018:c90003b3f8f8 EFLAGS: 00010293
RAX: 83c720e6 RBX: 0002 RCX: 8880251257c0
RDX:  RSI: 0002 RDI: 
RBP:  R08: 83c71bc3 R09: ed100e5a41b5
R10: ed100e5a41b5 R11: 11100e5a41b4 R12: dc00
R13: 888072d208f0 R14: 888072d20da0 R15: 
FS:  5685a300() GS:8880b990() knlGS:
CS:  0010 DS:  ES:  CR0: 80050033
CR2: 7ffd85832d68 CR3: 726a5000 CR4: 003506e0
DR0:  DR1:  DR2: 
DR3:  DR6: 

[f2fs-dev] [PATCH 1/2] f2fs_io: Fix out of tree builds

2022-12-21 Thread Khem Raj
Relative path does not work when searching for include files
when srcdir != builddir

Signed-off-by: Khem Raj 
---
 tools/f2fs_io/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/f2fs_io/Makefile.am b/tools/f2fs_io/Makefile.am
index 6c17db1..bc4f9d0 100644
--- a/tools/f2fs_io/Makefile.am
+++ b/tools/f2fs_io/Makefile.am
@@ -1,7 +1,7 @@
 ## Makefile.am
 
 if LINUX
-AM_CPPFLAGS = -I../../include
+AM_CPPFLAGS = -I$(top_srcdir)/include
 AM_CFLAGS = -Wall
 sbin_PROGRAMS = f2fs_io
 f2fs_io_SOURCES = f2fs_io.c
-- 
2.39.0



___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


[f2fs-dev] [PATCH 2/2] f2fs_io: Define _FILE_OFFSET_BITS=64

2022-12-21 Thread Khem Raj
Remove _LARGEFILE64_SOURCE, this is redundant when _FILE_OFFSET_BITS=64
additionally it fixes build with musl because the detection logic for
lseek64 fails because when using _LARGEFILE64_SOURCE musl also define's
lseek64 as an alias to lseek

Signed-off-by: Khem Raj 
---
 lib/libf2fs_io.c| 4 +++-
 tools/f2fs_io/f2fs_io.c | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/libf2fs_io.c b/lib/libf2fs_io.c
index 1a8167d..abb43a3 100644
--- a/lib/libf2fs_io.c
+++ b/lib/libf2fs_io.c
@@ -11,7 +11,9 @@
  *
  * Dual licensed under the GPL or LGPL version 2 licenses.
  */
-#define _LARGEFILE64_SOURCE
+#ifndef _FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS 64
+#endif
 
 #include 
 #include 
diff --git a/tools/f2fs_io/f2fs_io.c b/tools/f2fs_io/f2fs_io.c
index 6dcd840..cb99039 100644
--- a/tools/f2fs_io/f2fs_io.c
+++ b/tools/f2fs_io/f2fs_io.c
@@ -12,8 +12,8 @@
 #ifndef _LARGEFILE_SOURCE
 #define _LARGEFILE_SOURCE
 #endif
-#ifndef _LARGEFILE64_SOURCE
-#define _LARGEFILE64_SOURCE
+#ifndef _FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS 64
 #endif
 #ifndef O_LARGEFILE
 #define O_LARGEFILE 0
-- 
2.39.0



___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] Separate mailing list (and git and patchwork) for fsverity?

2022-12-21 Thread Eric Biggers
On Tue, Dec 13, 2022 at 11:24:28AM -0800, Eric Biggers wrote:
> Currently, fsverity development is reusing the same mailing list, git repo
> (though a different branch), and patchwork project as fscrypt --- mainly just
> because I was a little lazy and didn't bother to ask for new ones:
> 
> FSCRYPT: FILE SYSTEM LEVEL ENCRYPTION SUPPORT
> [...]
> L:  linux-fscr...@vger.kernel.org
> Q:  https://patchwork.kernel.org/project/linux-fscrypt/list/
> T:  git git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt.git
> [...]
> 
> FSVERITY: READ-ONLY FILE-BASED AUTHENTICITY PROTECTION
> [...]
> L:  linux-fscr...@vger.kernel.org
> Q:  https://patchwork.kernel.org/project/linux-fscrypt/list/
> T:  git git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt.git fsverity
> [...]
> 
> I think this is causing some confusion.  It also makes it so that people can't
> subscribe to the list for just one or the other.
> 
> What would people say about having a separate mailing list, git repo, and
> patchwork project for fsverity?  So the fsverity entry would look like:
> 
> FSVERITY: READ-ONLY FILE-BASED AUTHENTICITY PROTECTION
> [...]
> L:  linux-fsver...@vger.kernel.org
> Q:  https://patchwork.kernel.org/project/linux-fsverity/list/
> T:  git git://git.kernel.org/pub/scm/fs/fsverity/fsverity.git
> [...]
> 
> For the branches in the git repo, I'm thinking of using 'for-next' and
> 'for-current'.  (I'd also update the fscrypt ones to match; currently they are
> 'master' and 'for-stable'.)
> 
> If people are okay with these changes, I'll send off the needed requests to
> helpdesk and linux-next to make these changes, and send Linus a pull request 
> to
> update MAINTAINERS.  (And update fsverity-utils to point to the new list.)
> 

Any thoughts on this from anyone?

- Eric


___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


[f2fs-dev] [PATCH] f2fs: remove unnecessary blank lines

2022-12-21 Thread Yangtao Li via Linux-f2fs-devel
Just cleanup.

Signed-off-by: Yangtao Li 
---
 fs/f2fs/f2fs.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index e8953c3dc81a..3e22de1f405e 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -1384,8 +1384,6 @@ enum {
MEMORY_MODE_LOW,/* memory mode for low memry devices */
 };
 
-
-
 static inline int f2fs_test_bit(unsigned int nr, char *addr);
 static inline void f2fs_set_bit(unsigned int nr, char *addr);
 static inline void f2fs_clear_bit(unsigned int nr, char *addr);
-- 
2.25.1



___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


[f2fs-dev] [PATCH 1/2] f2fs: support accounting iostat count and avg_bytes

2022-12-21 Thread Yangtao Li via Linux-f2fs-devel
Previously, we supported to account iostat io_bytes,
in this patch, it adds to account iostat count and avg_bytes:

time:   1671648667
io_bytes countavg_bytes
[WRITE]
app buffered data:  31   215

Signed-off-by: Yangtao Li 
---
 fs/f2fs/f2fs.h   |   1 +
 fs/f2fs/iostat.c | 184 ---
 2 files changed, 126 insertions(+), 59 deletions(-)

diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index e8953c3dc81a..b116c778fce6 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -1864,6 +1864,7 @@ struct f2fs_sb_info {
 #ifdef CONFIG_F2FS_IOSTAT
/* For app/fs IO statistics */
spinlock_t iostat_lock;
+   unsigned long long iostat_count[NR_IO_TYPE];
unsigned long long rw_iostat[NR_IO_TYPE];
unsigned long long prev_rw_iostat[NR_IO_TYPE];
bool iostat_enable;
diff --git a/fs/f2fs/iostat.c b/fs/f2fs/iostat.c
index 3166a8939ed4..3d4503fef183 100644
--- a/fs/f2fs/iostat.c
+++ b/fs/f2fs/iostat.c
@@ -18,6 +18,13 @@
 static struct kmem_cache *bio_iostat_ctx_cache;
 static mempool_t *bio_iostat_ctx_pool;
 
+static inline unsigned long long iostat_get_avg_bytes(struct f2fs_sb_info *sbi,
+   enum iostat_type type)
+{
+   return sbi->iostat_count[type] ? div64_u64(sbi->rw_iostat[type],
+   sbi->iostat_count[type]) : 0;
+}
+
 int __maybe_unused iostat_info_seq_show(struct seq_file *seq, void *offset)
 {
struct super_block *sb = seq->private;
@@ -28,69 +35,121 @@ int __maybe_unused iostat_info_seq_show(struct seq_file 
*seq, void *offset)
return 0;
 
seq_printf(seq, "time:  %-16llu\n", now);
+   seq_printf(seq, "\t\t\t%-16s %-16s %-16s\n",
+   "io_bytes", "count", "avg_bytes");
 
/* print app write IOs */
seq_puts(seq, "[WRITE]\n");
-   seq_printf(seq, "app buffered data: %-16llu\n",
-   sbi->rw_iostat[APP_BUFFERED_IO]);
-   seq_printf(seq, "app direct data:   %-16llu\n",
-   sbi->rw_iostat[APP_DIRECT_IO]);
-   seq_printf(seq, "app mapped data:   %-16llu\n",
-   sbi->rw_iostat[APP_MAPPED_IO]);
-   seq_printf(seq, "app buffered cdata:%-16llu\n",
-   sbi->rw_iostat[APP_BUFFERED_CDATA_IO]);
-   seq_printf(seq, "app mapped cdata:  %-16llu\n",
-   sbi->rw_iostat[APP_MAPPED_CDATA_IO]);
+   seq_printf(seq, "app buffered data: %-16llu %-16llu %-16llu\n",
+   sbi->rw_iostat[APP_BUFFERED_IO],
+   sbi->iostat_count[APP_BUFFERED_IO],
+   iostat_get_avg_bytes(sbi, APP_BUFFERED_IO));
+   seq_printf(seq, "app direct data:   %-16llu %-16llu %-16llu\n",
+   sbi->rw_iostat[APP_DIRECT_IO],
+   sbi->iostat_count[APP_DIRECT_IO],
+   iostat_get_avg_bytes(sbi, APP_DIRECT_IO));
+   seq_printf(seq, "app mapped data:   %-16llu %-16llu %-16llu\n",
+   sbi->rw_iostat[APP_MAPPED_IO],
+   sbi->iostat_count[APP_MAPPED_IO],
+   iostat_get_avg_bytes(sbi, APP_MAPPED_IO));
+   seq_printf(seq, "app buffered cdata:%-16llu %-16llu %-16llu\n",
+   sbi->rw_iostat[APP_BUFFERED_CDATA_IO],
+   sbi->iostat_count[APP_BUFFERED_CDATA_IO],
+   iostat_get_avg_bytes(sbi, 
APP_BUFFERED_CDATA_IO));
+   seq_printf(seq, "app mapped cdata:  %-16llu %-16llu %-16llu\n",
+   sbi->rw_iostat[APP_MAPPED_CDATA_IO],
+   sbi->iostat_count[APP_MAPPED_CDATA_IO],
+   iostat_get_avg_bytes(sbi, APP_MAPPED_CDATA_IO));
 
/* print fs write IOs */
-   seq_printf(seq, "fs data:   %-16llu\n",
-   sbi->rw_iostat[FS_DATA_IO]);
-   seq_printf(seq, "fs cdata:  %-16llu\n",
-   sbi->rw_iostat[FS_CDATA_IO]);
-   seq_printf(seq, "fs node:   %-16llu\n",
-   sbi->rw_iostat[FS_NODE_IO]);
-   seq_printf(seq, "fs meta:   %-16llu\n",
-   sbi->rw_iostat[FS_META_IO]);
-   seq_printf(seq, "fs gc data:%-16llu\n",
-   sbi->rw_iostat[FS_GC_DATA_IO]);
-   seq_printf(seq, "fs gc node:%-16llu\n",
-   sbi->rw_iostat[FS_GC_NODE_IO]);
-   seq_printf(seq, "fs cp data:%-16llu\n",
-   sbi->rw_iostat[FS_CP_DATA_IO]);
-   seq_printf(seq, "fs cp node:%-16llu\n",
-   sbi->rw_iostat[FS_CP_NOD

[f2fs-dev] [PATCH 2/2] f2fs: add iostat support for flush

2022-12-21 Thread Yangtao Li via Linux-f2fs-devel
In this patch, it adds to account flush count.

Signed-off-by: Yangtao Li 
---
 fs/f2fs/f2fs.h| 1 +
 fs/f2fs/iostat.c  | 4 
 fs/f2fs/segment.c | 2 ++
 3 files changed, 7 insertions(+)

diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index b116c778fce6..7d7b96d1e1d2 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -1194,6 +1194,7 @@ enum iostat_type {
 
/* other */
FS_DISCARD, /* discard */
+   FS_FLUSH,   /* flush */
NR_IO_TYPE,
 };
 
diff --git a/fs/f2fs/iostat.c b/fs/f2fs/iostat.c
index 3d4503fef183..721294c40399 100644
--- a/fs/f2fs/iostat.c
+++ b/fs/f2fs/iostat.c
@@ -150,6 +150,10 @@ int __maybe_unused iostat_info_seq_show(struct seq_file 
*seq, void *offset)
sbi->rw_iostat[FS_DISCARD],
sbi->iostat_count[FS_DISCARD],
iostat_get_avg_bytes(sbi, FS_DISCARD));
+   seq_printf(seq, "fs flush:  %-16llu %-16llu %-16llu\n",
+   sbi->rw_iostat[FS_FLUSH],
+   sbi->iostat_count[FS_FLUSH],
+   iostat_get_avg_bytes(sbi, FS_FLUSH));
 
return 0;
 }
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index af2d522b1a89..ec4ed7603d1f 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -505,6 +505,8 @@ static int __submit_flush_wait(struct f2fs_sb_info *sbi,
struct block_device *bdev)
 {
int ret = blkdev_issue_flush(bdev);
+   if (!ret)
+   f2fs_update_iostat(sbi, NULL, FS_FLUSH, 0);
 
trace_f2fs_issue_flush(bdev, test_opt(sbi, NOBARRIER),
test_opt(sbi, FLUSH_MERGE), ret);
-- 
2.25.1



___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [RFC PATCH] f2fs: Convert f2fs_write_cache_pages() to use filemap_get_folios_tag()

2022-12-21 Thread Vishal Moola
On Thu, Dec 15, 2022 at 10:45 AM Matthew Wilcox  wrote:
>
> On Thu, Dec 15, 2022 at 09:48:41AM +0800, Chao Yu wrote:
> > On 2022/12/13 3:13, Vishal Moola (Oracle) wrote:
> > > +add_more:
> > > +   pages[nr_pages] = folio_page(folio,idx);
> > > +   folio_ref_inc(folio);
> >
> > It looks if CONFIG_LRU_GEN is not set, folio_ref_inc() does nothing. For 
> > those
> > folios recorded in pages array, we need to call folio_get() here to add one 
> > more
> > reference on each of them?
>
> static inline void folio_get(struct folio *folio)
> {
> VM_BUG_ON_FOLIO(folio_ref_zero_or_close_to_overflow(folio), folio);
> folio_ref_inc(folio);
> }
>
> That said, folio_ref_inct() is very much MM-internal and filesystems
> should be using folio_get(), so please make that modification in the
> next revision, Vishal.

Ok, I'll go through and fix all of those in the next version.


___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH REPOST] f2fs: file: drop useless initializer in expand_inode_data()

2022-12-21 Thread Sergey Shtylyov
On 12/21/22 3:34 PM, Chao Yu wrote:

[...]
>>> In expand_inode_data(), the 'new_size' local variable is initialized to
>>> the result of i_size_read(), however this value isn't ever used,  so we
>>> can drop this initializer...
>>>
>>> Found by Linux Verification Center (linuxtesting.org) with the SVACE static
>>> analysis tool.
>>>
>>> Signed-off-by: Sergey Shtylyov 
>>>
>>> ---
>>> This patch is against the 'dev' branch of Jaegeuk Kim's F2FS repo...
>>> Reposting with ISP RAS mailing lists CC'ed now...
>>
>> Why do you repeatedly send a patch that cannot be applied, and this does not 
>> have
> 
> The format is weired, but still I can apply this into my git repo...

   This is just the quilt's format. I normally use quilt for development
and then import my patch seies to git in order to prepare it for posting.
If I post a single patch, I just skip the git step and post with my MTA...

[...]

>> Thx,
>> Yangtao

MBR, Sergey


___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH REPOST] f2fs: file: drop useless initializer in expand_inode_data()

2022-12-21 Thread Sergey Shtylyov
On 12/21/22 5:46 PM, Sergey Shtylyov wrote:

>>> In expand_inode_data(), the 'new_size' local variable is initialized to
>>> the result of i_size_read(), however this value isn't ever used,  so we
>>> can drop this initializer...
>>>
>>> Found by Linux Verification Center (linuxtesting.org) with the SVACE static
>>> analysis tool.
>>>
>>> Signed-off-by: Sergey Shtylyov 
>>>
>>> ---
>>> This patch is against the 'dev' branch of Jaegeuk Kim's F2FS repo...
>>> Reposting with ISP RAS mailing lists CC'ed now...
>>
>> Why do you repeatedly send a patch

   Sorry, 1st time I forgot to do the internal CC dance -- CCing couple SVACE
(static analyzer) specific mailing lists...

[...]

>> Thx,
>> Yangtao

MBR, Sergey


___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH REPOST] f2fs: file: drop useless initializer in expand_inode_data()

2022-12-21 Thread Sergey Shtylyov
Hello!

On 12/21/22 6:30 AM, Yangtao Li wrote:

>> In expand_inode_data(), the 'new_size' local variable is initialized to
>> the result of i_size_read(), however this value isn't ever used,  so we
>> can drop this initializer...
>>
>> Found by Linux Verification Center (linuxtesting.org) with the SVACE static
>> analysis tool.
>>
>> Signed-off-by: Sergey Shtylyov 
>>
>> ---
>> This patch is against the 'dev' branch of Jaegeuk Kim's F2FS repo...
>> Reposting with ISP RAS mailing lists CC'ed now...
> 
> Why do you repeatedly send a patch that cannot be applied,

   Why (it does apply to your 'dev' branch)? Because of the merge window?

> and this does not have a CC on linux-kernel.vger.kernel.org.

   I normnally avoid CCing LKML as my patches are not generally interesting
to the wide public (I think)...

> Otherwise, code modification looks good to me.

   Thanx!

> Thx,
> Yangtao

MBR, Sergey


___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH REPOST] f2fs: file: drop useless initializer in expand_inode_data()

2022-12-21 Thread Chao Yu

Hi all,

On 2022/12/21 11:30, Yangtao Li wrote:

Hi Sergey,


In expand_inode_data(), the 'new_size' local variable is initialized to
the result of i_size_read(), however this value isn't ever used,  so we
can drop this initializer...

Found by Linux Verification Center (linuxtesting.org) with the SVACE static
analysis tool.

Signed-off-by: Sergey Shtylyov 

---
This patch is against the 'dev' branch of Jaegeuk Kim's F2FS repo...
Reposting with ISP RAS mailing lists CC'ed now...


Why do you repeatedly send a patch that cannot be applied, and this does not 
have


The format is weired, but still I can apply this into my git repo...


a CC on linux-kernel.vger.kernel.org.


I guess linux-kernel.vger.kernel.org is not mandatory, feel free
to Cc this mailing list.

Thanks,



Otherwise, code modification looks good to me.

Thx,
Yangtao



___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH REPOST] f2fs: file: drop useless initializer in expand_inode_data()

2022-12-21 Thread Chao Yu

On 2022/12/21 1:17, Sergey Shtylyov wrote:

In expand_inode_data(), the 'new_size' local variable is initialized to
the result of i_size_read(), however this value isn't ever used,  so we
can drop this initializer...

Found by Linux Verification Center (linuxtesting.org) with the SVACE static
analysis tool.

Signed-off-by: Sergey Shtylyov 


Reviewed-by: Chao Yu 

Thanks,


___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH] f2fs: remove unused PAGE_PRIVATE_ATOMIC_WRITE

2022-12-21 Thread Chao Yu

On 2022/12/21 11:59, Yangtao Li wrote:

  PAGE_PRIVATE_GET_FUNC(reference, REF_RESOURCE);
  

  PAGE_PRIVATE_CLEAR_FUNC(reference, REF_RESOURCE);


Delete those two too?


Oh, thank for checking PAGE_PRIVATE_REF_RESOURCE's usage, I found we
need clear_page_private_reference(), see “[PATCH] f2fs: fix to call
clear_page_private_reference in .{release,invalid}_folio”

Thanks,



Otherwise, looks good to me.

Thx,
Yangtao



___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


[f2fs-dev] [PATCH] f2fs: fix to support .migrate_folio for compressed inode

2022-12-21 Thread Chao Yu
Add missed .migrate_folio for compressed inode, in order to support
migration of compressed inode's page.

Signed-off-by: Chao Yu 
---
 fs/f2fs/compress.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c
index 2532f369cb10..719b0a0184b0 100644
--- a/fs/f2fs/compress.c
+++ b/fs/f2fs/compress.c
@@ -1813,6 +1813,7 @@ unsigned int f2fs_cluster_blocks_are_contiguous(struct 
dnode_of_data *dn)
 const struct address_space_operations f2fs_compress_aops = {
.release_folio = f2fs_release_folio,
.invalidate_folio = f2fs_invalidate_folio,
+   .migrate_folio  = filemap_migrate_folio,
 };
 
 struct address_space *COMPRESS_MAPPING(struct f2fs_sb_info *sbi)
-- 
2.36.1



___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


[f2fs-dev] [PATCH] f2fs: fix to call clear_page_private_reference in .{release, invalid}_folio

2022-12-21 Thread Chao Yu
b763f3bedc2d ("f2fs: restructure f2fs page.private layout") missed
to call clear_page_private_reference() in .{release,invalid}_folio,
fix it, though it's not a big deal since folio_detach_private() was
called to clear all privae info and reference count in the page.

BTW, remove page_private_reference() definition as it never be used.

Signed-off-by: Chao Yu 
---
 fs/f2fs/data.c | 2 ++
 fs/f2fs/f2fs.h | 1 -
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index b1ec0fbf1c8f..53d8945df2c1 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -3696,6 +3696,7 @@ void f2fs_invalidate_folio(struct folio *folio, size_t 
offset, size_t length)
}
}
 
+   clear_page_private_reference(&folio->page);
clear_page_private_gcing(&folio->page);
 
if (test_opt(sbi, COMPRESS_CACHE) &&
@@ -3721,6 +3722,7 @@ bool f2fs_release_folio(struct folio *folio, gfp_t wait)
clear_page_private_data(&folio->page);
}
 
+   clear_page_private_reference(&folio->page);
clear_page_private_gcing(&folio->page);
 
folio_detach_private(folio);
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 9da26d4ec017..049d4fa0b59e 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -1453,7 +1453,6 @@ static inline void clear_page_private_##name(struct page 
*page) \
 }
 
 PAGE_PRIVATE_GET_FUNC(nonpointer, NOT_POINTER);
-PAGE_PRIVATE_GET_FUNC(reference, REF_RESOURCE);
 PAGE_PRIVATE_GET_FUNC(inline, INLINE_INODE);
 PAGE_PRIVATE_GET_FUNC(gcing, ONGOING_MIGRATION);
 PAGE_PRIVATE_GET_FUNC(dummy, DUMMY_WRITE);
-- 
2.36.1



___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel