Re: [f2fs-dev] [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr

2022-03-03 Thread Xiaomeng Tong
On Thu, 3 Mar 2022 12:18:24 +, Daniel Thompson wrote: > On Thu, Mar 03, 2022 at 03:26:57PM +0800, Xiaomeng Tong wrote: > > On Thu, 3 Mar 2022 04:58:23 +, David Laight wrote: > > > on 3 Mar 2022 10:27:29 +0800, Xiaomeng Tong wrote: > > > > The problem is the mis-use of iterator outside the l

Re: [f2fs-dev] [PATCH 06/11] ceph: remove reliance on bdi congestion

2022-03-03 Thread NeilBrown
On Thu, 24 Feb 2022, Jeff Layton wrote: > On Thu, 2022-02-24 at 16:41 +1100, NeilBrown wrote: > > On Thu, 24 Feb 2022, Jeff Layton wrote: > > > On Tue, 2022-02-22 at 14:17 +1100, NeilBrown wrote: > > > > The bdi congestion tracking in not widely used and will be removed. > > > > > > > > CEPHfs is

Re: [f2fs-dev] [PATCH 04/11] fuse: remove reliance on bdi congestion

2022-03-03 Thread NeilBrown
On Wed, 02 Mar 2022, Miklos Szeredi wrote: > On Tue, 22 Feb 2022 at 04:18, NeilBrown wrote: > > > > The bdi congestion tracking in not widely used and will be removed. > > > > Fuse is one of a small number of filesystems that uses it, setting both > > the sync (read) and async (write) congestion f

Re: [f2fs-dev] [PATCH 03/11] MM: improve cleanup when ->readpages doesn't process all pages.

2022-03-03 Thread NeilBrown
On Wed, 02 Mar 2022, Miklos Szeredi wrote: > On Tue, 22 Feb 2022 at 04:18, NeilBrown wrote: > > > > If ->readpages doesn't process all the pages, then it is best to act as > > though they weren't requested so that a subsequent readahead can try > > again. > > So: > > - remove any 'ahead' pages f

[f2fs-dev] [PATCH 1/2] f2fs: avoid an infinite loop in f2fs_sync_dirty_inodes

2022-03-03 Thread Jaegeuk Kim
If one read IO is always failing, we can fall into an infinite loop in f2fs_sync_dirty_inodes. This happens during xfstests/generic/475. [ 142.803335] Buffer I/O error on dev dm-1, logical block 8388592, async page read ... [ 382.887210] submit_bio_noacct+0xdd/0x2a0 [ 382.887213] submit_bio+

[f2fs-dev] [PATCH 2/2] f2fs: introduce F2FS_UNFAIR_RWSEM to support unfair rwsem

2022-03-03 Thread Jaegeuk Kim
Unfair rwsem should be used when blk-cg is on. Otherwise, there is regression. FYI, we noticed a -26.7% regression of aim7.jobs-per-min due to commit: commit: e4544b63a7ee49e7fbebf35ece0a6acd3b9617ae ("f2fs: move f2fs to use reader-unfair rwsems") https://git.kernel.org/cgit/linux/kernel/git/nex

[f2fs-dev] [Bug 215657] UBSAN: array-index-out-of-bounds in fs/f2fs/segment.c when mount and operate a corrupted image

2022-03-03 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=215657 Chao Yu ([email protected]) changed: What|Removed |Added Status|NEW |ASSIGNED CC|

[f2fs-dev] [PATCH] f2fs: fix to do sanity check on curseg->alloc_type

2022-03-03 Thread Chao Yu
As Wenqing Liu reported in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215657 - Overview UBSAN: array-index-out-of-bounds in fs/f2fs/segment.c:3460:2 when mount and operate a corrupted image - Reproduce tested on kernel 5.17-rc4, 5.17-rc6 1. mkdir test_crash 2. cd test_crash 3. unzip

[f2fs-dev] [Bug 215657] New: UBSAN: array-index-out-of-bounds in fs/f2fs/segment.c when mount and operate a corrupted image

2022-03-03 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=215657 Bug ID: 215657 Summary: UBSAN: array-index-out-of-bounds in fs/f2fs/segment.c when mount and operate a corrupted image Product: File System Version: 2.5 Kernel Version: 5.17-rc4,

Re: [f2fs-dev] [PATCH] f2fs: fix to avoid potential deadlock

2022-03-03 Thread Jaegeuk Kim
On 03/03, Chao Yu wrote: > On 2022/3/3 3:45, Jaegeuk Kim wrote: > > On 03/02, Chao Yu wrote: > > > On 2022/3/2 13:26, Jaegeuk Kim wrote: > > > > On 03/02, Chao Yu wrote: > > > > > ping, > > > > > > > > > > On 2022/2/25 11:02, Chao Yu wrote: > > > > > > On 2022/2/3 22:57, Chao Yu wrote: > > > > > >

Re: [f2fs-dev] [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr

2022-03-03 Thread Xiaomeng Tong
> From: Xiaomeng Tong > > Sent: 03 March 2022 07:27 > > > > On Thu, 3 Mar 2022 04:58:23 +, David Laight wrote: > > > on 3 Mar 2022 10:27:29 +0800, Xiaomeng Tong wrote: > > > > The problem is the mis-use of iterator outside the loop on exit, and > > > > the iterator will be the HEAD's container

Re: [f2fs-dev] [Kgdb-bugreport] [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr

2022-03-03 Thread Daniel Thompson
On Thu, Mar 03, 2022 at 03:26:57PM +0800, Xiaomeng Tong wrote: > On Thu, 3 Mar 2022 04:58:23 +, David Laight wrote: > > on 3 Mar 2022 10:27:29 +0800, Xiaomeng Tong wrote: > > > The problem is the mis-use of iterator outside the loop on exit, and > > > the iterator will be the HEAD's container_o

Re: [f2fs-dev] [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr

2022-03-03 Thread Dan Carpenter
On Wed, Mar 02, 2022 at 10:29:31AM +0100, Rasmus Villemoes wrote: > This won't help the current issue (because it doesn't exist and might > never), but just in case some compiler people are listening, I'd like to > have some sort of way to tell the compiler "treat this variable as > uninitialized f

Re: [f2fs-dev] [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr

2022-03-03 Thread David Laight
From: Xiaomeng Tong > Sent: 03 March 2022 07:27 > > On Thu, 3 Mar 2022 04:58:23 +, David Laight wrote: > > on 3 Mar 2022 10:27:29 +0800, Xiaomeng Tong wrote: > > > The problem is the mis-use of iterator outside the loop on exit, and > > > the iterator will be the HEAD's container_of pointer wh

Re: [f2fs-dev] [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr

2022-03-03 Thread Dan Carpenter
On Wed, Mar 02, 2022 at 12:07:04PM -0800, Kees Cook wrote: > On Wed, Mar 02, 2022 at 10:29:31AM +0100, Rasmus Villemoes wrote: > > This won't help the current issue (because it doesn't exist and might > > never), but just in case some compiler people are listening, I'd like to > > have some sort of

Re: [f2fs-dev] [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr

2022-03-03 Thread Xiaomeng Tong
correct for typo: -for (struct list_head *list = head->next, cond = (struct list_head *)-1; cond == (struct list_head *)-1; cond = NULL) \ +for (struct list_head *list = head->next, *cond = (struct list_head *)-1; cond == (struct list_head *)-1; cond = NULL) \ -- Xiaomeng Tong ___

Re: [f2fs-dev] [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr

2022-03-03 Thread Xiaomeng Tong
> I think this would make sense, it would mean you only assign the containing > element on valid elements. > > I was thinking something along the lines of: > > #define list_for_each_entry(pos, head, member) > \ > for (struct list_head *list = head->next