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

2022-03-01 Thread Linus Torvalds
On Tue, Mar 1, 2022 at 11:06 AM Linus Torvalds wrote: > > So instead of that simple "if (!entry)", we'd effectively have to > continue to use something that still works with the old world order > (ie that "if (list_entry_is_head())" model). Just to prove my point about how this is painful, that

Re: [f2fs-dev] [PATCH 6/6] treewide: remove check of list iterator against head past the loop body

2022-03-01 Thread Linus Torvalds
So looking at this patch, I really reacted to the fact that quite often the "use outside the loop" case is all kinds of just plain unnecessary, but _used_ to be a convenience feature. I'll just quote the first chunk in it's entirely as an example - not because I think this chunk is particularly

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

2022-03-01 Thread David Laight
From: Linus Torvalds > Sent: 01 March 2022 19:07 > On Mon, Feb 28, 2022 at 2:29 PM James Bottomley > wrote: > > > > However, if the desire is really to poison the loop variable then we > > can do > > > > #define list_for_each_entry(pos, head, member) \ > > for

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

2022-03-01 Thread Linus Torvalds
On Tue, Mar 1, 2022 at 2:58 PM David Laight wrote: > > Can it be resolved by making: > #define list_entry_is_head(pos, head, member) ((pos) == NULL) > and double-checking that it isn't used anywhere else (except in > the list macros themselves). Well, yes, except for the fact that then the name

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

2022-03-01 Thread David Laight
From: Linus Torvalds > Sent: 01 March 2022 23:03 > > On Tue, Mar 1, 2022 at 2:58 PM David Laight wrote: > > > > Can it be resolved by making: > > #define list_entry_is_head(pos, head, member) ((pos) == NULL) > > and double-checking that it isn't used anywhere else (except in > > the list macros

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

2022-03-01 Thread Linus Torvalds
On Tue, Mar 1, 2022 at 3:19 PM David Laight wrote: > > Having said that there are so few users of list_entry_is_head() > it is reasonable to generate two new names. Well, the problem is that the users of list_entry_is_head() may be few - but there are a number of _other_ ways to check "was that

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

2022-03-01 Thread Kees Cook
On Tue, Mar 01, 2022 at 12:28:15PM +0100, Jakob Koschel wrote: > Based on the coccinelle script there are ~480 cases that need fixing > in total. I'll now finish all of them and then split them by > submodules as Greg suggested and repost a patch set per submodule. > Sounds good? To help with

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

2022-03-01 Thread Linus Torvalds
On Mon, Feb 28, 2022 at 2:29 PM James Bottomley wrote: > > However, if the desire is really to poison the loop variable then we > can do > > #define list_for_each_entry(pos, head, member) \ > for (pos = list_first_entry(head, typeof(*pos), member);\ >

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

2022-03-01 Thread Greg KH
On Tue, Mar 01, 2022 at 12:28:15PM +0100, Jakob Koschel wrote: > > > > On 1. Mar 2022, at 01:41, Linus Torvalds > > wrote: > > > > On Mon, Feb 28, 2022 at 1:47 PM Jakob Koschel > > wrote: > >> > >> The goal of this is to get compiler warnings right? This would indeed be > >> great. > > >

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

2022-03-01 Thread Matthew Wilcox
On Tue, Mar 01, 2022 at 10:14:07AM -0800, Kees Cook wrote: > On Mon, Feb 28, 2022 at 04:45:11PM -0800, Linus Torvalds wrote: > > Really. The "-Wshadow doesn't work on the kernel" is not some new > > issue, because you have to do completely insane things to the source > > code to enable it. > >

Re: [f2fs-dev] [GIT PULL] zstd changes for v5.16

2022-03-01 Thread Nick Terrell via Linux-f2fs-devel
> On Feb 20, 2022, at 1:45 AM, Sedat Dilek wrote: > > On Tue, Nov 9, 2021 at 2:24 AM Nick Terrell wrote: >> >> From: Nick Terrell >> >> Hi Linus, >> >> I am sending you a pull request to add myself as the maintainer of zstd and >> update the zstd version in the kernel, which is now 4

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

2022-03-01 Thread Jakob Koschel
> On 1. Mar 2022, at 18:36, Greg KH wrote: > > On Tue, Mar 01, 2022 at 12:28:15PM +0100, Jakob Koschel wrote: >> >> >>> On 1. Mar 2022, at 01:41, Linus Torvalds >>> wrote: >>> >>> On Mon, Feb 28, 2022 at 1:47 PM Jakob Koschel >>> wrote: The goal of this is to get compiler

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

2022-03-01 Thread Kees Cook
On Mon, Feb 28, 2022 at 04:45:11PM -0800, Linus Torvalds wrote: > Really. The "-Wshadow doesn't work on the kernel" is not some new > issue, because you have to do completely insane things to the source > code to enable it. The first big glitch with -Wshadow was with shadowed global variables.

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

2022-03-01 Thread Miklos Szeredi
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 flags at what it determines > are appropriate times. >

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

2022-03-01 Thread Greg KH
On Tue, Mar 01, 2022 at 06:40:04PM +0100, Jakob Koschel wrote: > > > > On 1. Mar 2022, at 18:36, Greg KH wrote: > > > > On Tue, Mar 01, 2022 at 12:28:15PM +0100, Jakob Koschel wrote: > >> > >> > >>> On 1. Mar 2022, at 01:41, Linus Torvalds > >>> wrote: > >>> > >>> On Mon, Feb 28, 2022 at

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

2022-03-01 Thread Linus Torvalds
On Tue, Mar 1, 2022 at 10:14 AM Kees Cook wrote: > > The first big glitch with -Wshadow was with shadowed global variables. > GCC 4.8 fixed that, but it still yells about shadowed functions. What > _almost_ works is -Wshadow=local. Heh. Yeah, I just have long memories of "-Wshadow was a

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

2022-03-01 Thread Greg KH
On Mon, Feb 28, 2022 at 01:06:57PM +0100, Jakob Koschel wrote: > > > > On 28. Feb 2022, at 12:20, Greg KH wrote: > > > > On Mon, Feb 28, 2022 at 12:08:18PM +0100, Jakob Koschel wrote: > >> If the list does not contain the expected element, the value of > >> list_for_each_entry() iterator will

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

2022-03-01 Thread Chao Yu
ping, On 2022/2/25 11:02, Chao Yu wrote: On 2022/2/3 22:57, Chao Yu wrote: On 2022/2/3 9:51, Jaegeuk Kim wrote: On 01/29, Chao Yu wrote: On 2022/1/29 8:37, Jaegeuk Kim wrote: On 01/28, Chao Yu wrote: On 2022/1/28 5:59, Jaegeuk Kim wrote: On 01/27, Chao Yu wrote: Quoted from Jing Xia's

Re: [f2fs-dev] [PATCH v2] mkfs.f2fs: set project quota by default for -g android

2022-03-01 Thread Chao Yu
On 2022/2/26 2:36, Jaegeuk Kim wrote: On 02/25, Chao Yu wrote: On 2022/2/9 7:39, Jaegeuk Kim wrote: With this patch, "-g android" enables usr/grp/proj quota by default. 1) -O quota : enables usr/grp 2) -O project_quota -O extra_attr : enabled prj 3) -O quota -O project_quota -O extra_attr :

Re: [f2fs-dev] [PATCH v2] f2fs: avoid sb_start_intwrite during eviction

2022-03-01 Thread Jaegeuk Kim
On 03/02, Chao Yu wrote: > On 2022/3/1 12:48, Jaegeuk Kim wrote: > > 1. waiting for f2fs_evict_inode > > [ 5560.043945] __wait_on_freeing_inode+0xac/0xf0 > > [ 5560.045540] ? var_wake_function+0x30/0x30 > > [ 5560.047036] find_inode_fast+0x6d/0xc0 > > [ 5560.048473] iget_locked+0x79/0x230 > >

Re: [f2fs-dev] [PATCH v2] f2fs: avoid sb_start_intwrite during eviction

2022-03-01 Thread Jaegeuk Kim
On 03/01, Jaegeuk Kim wrote: > On 03/02, Chao Yu wrote: > > On 2022/3/1 12:48, Jaegeuk Kim wrote: > > > 1. waiting for f2fs_evict_inode > > > [ 5560.043945] __wait_on_freeing_inode+0xac/0xf0 > > > [ 5560.045540] ? var_wake_function+0x30/0x30 > > > [ 5560.047036] find_inode_fast+0x6d/0xc0 > > >

Re: [f2fs-dev] [PATCH v2] f2fs: avoid sb_start_intwrite during eviction

2022-03-01 Thread Jaegeuk Kim
On 03/01, Jaegeuk Kim wrote: > On 03/01, Jaegeuk Kim wrote: > > On 03/02, Chao Yu wrote: > > > On 2022/3/1 12:48, Jaegeuk Kim wrote: > > > > 1. waiting for f2fs_evict_inode > > > > [ 5560.043945] __wait_on_freeing_inode+0xac/0xf0 > > > > [ 5560.045540] ? var_wake_function+0x30/0x30 > > > > [

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

2022-03-01 Thread Jaegeuk Kim
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: > > > On 2022/2/3 9:51, Jaegeuk Kim wrote: > > > > On 01/29, Chao Yu wrote: > > > > > On 2022/1/29 8:37, Jaegeuk Kim wrote: > > > > > > On 01/28, Chao Yu wrote: > > > > > > > On 2022/1/28

Re: [f2fs-dev] [PATCH v2] f2fs: avoid sb_start_intwrite during eviction

2022-03-01 Thread Chao Yu
On 2022/3/2 13:45, Jaegeuk Kim wrote: On 03/01, Jaegeuk Kim wrote: On 03/01, Jaegeuk Kim wrote: On 03/02, Chao Yu wrote: On 2022/3/1 12:48, Jaegeuk Kim wrote: 1. waiting for f2fs_evict_inode [ 5560.043945] __wait_on_freeing_inode+0xac/0xf0 [ 5560.045540] ? var_wake_function+0x30/0x30 [

Re: [f2fs-dev] [PATCH v2] f2fs: avoid sb_start_intwrite during eviction

2022-03-01 Thread Chao Yu
On 2022/3/1 12:48, Jaegeuk Kim wrote: 1. waiting for f2fs_evict_inode [ 5560.043945] __wait_on_freeing_inode+0xac/0xf0 [ 5560.045540] ? var_wake_function+0x30/0x30 [ 5560.047036] find_inode_fast+0x6d/0xc0 [ 5560.048473] iget_locked+0x79/0x230 [ 5560.049933] f2fs_iget+0x27/0x1200 [f2fs] [

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

2022-03-01 Thread Miklos Szeredi
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 from the page cache so they can be loaded > with

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

2022-03-01 Thread Jakob Koschel
> On 1. Mar 2022, at 01:41, Linus Torvalds > wrote: > > On Mon, Feb 28, 2022 at 1:47 PM Jakob Koschel wrote: >> >> The goal of this is to get compiler warnings right? This would indeed be >> great. > > Yes, so I don't mind having a one-time patch that has been gathered > using some