[PATCH] fs: ext4: mballoc: amend goto to cleanup groupinfo memory correctly

2021-04-12 Thread Phillip Potter
is then correctly run. Fixes memory leak reported by syzbot at: https://syzkaller.appspot.com/bug?extid=aa12d6106ea4ca1b6aae Reported-by: syzbot+aa12d6106ea4ca1b6...@syzkaller.appspotmail.com Signed-off-by: Phillip Potter --- fs/ext4/mballoc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH] net: geneve: check skb is large enough for IPv4/IPv6 header

2021-04-11 Thread Phillip Potter
://syzkaller.appspot.com/bug?id=abe95dc3e3e9667fc23b8d81f29ecad95c6f106f Suggested-by: Eric Dumazet Reported-by: syzbot+2e406a9ac75bb71d4...@syzkaller.appspotmail.com Signed-off-by: Phillip Potter --- drivers/net/geneve.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/geneve.c b/drivers/net

Re: [PATCH] net: core: sk_buff: zero-fill skb->data in __alloc_skb function

2021-04-10 Thread Phillip Potter
On Sat, Apr 10, 2021 at 01:00:34PM +0200, Eric Dumazet wrote: > On Sat, Apr 10, 2021 at 12:12 PM Eric Dumazet wrote: > > > > On Sat, Apr 10, 2021 at 11:51 AM Phillip Potter > > wrote: > > > > > > Zero-fill skb->data in __alloc_skb function of net/

[PATCH] net: core: sk_buff: zero-fill skb->data in __alloc_skb function

2021-04-10 Thread Phillip Potter
1d4...@syzkaller.appspotmail.com Signed-off-by: Phillip Potter --- net/core/skbuff.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 785daff48030..9ac26cdb5417 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -215,6 +215,7 @@ struct sk_buff *__alloc_

[PATCH v3] net: tun: set tun->dev->addr_len during TUNSETLINK processing

2021-04-06 Thread Phillip Potter
om/bug?id=0766d38c656abeace60621896d705743aeefed51 Reported-by: syzbot+001516d86dbe88862...@syzkaller.appspotmail.com Diagnosed-by: Eric Dumazet Signed-off-by: Phillip Potter --- V2: Removed inline specifier from tun_get_addr_len function. V3: Gave appropriate credit to Eric Dumazet for diag

Re: [PATCH] net: tun: set tun->dev->addr_len during TUNSETLINK processing

2021-04-06 Thread Phillip Potter
On Tue, Apr 06, 2021 at 07:26:29PM +0200, Eric Dumazet wrote: > > > On 4/5/21 1:35 PM, Phillip Potter wrote: > > When changing type with TUNSETLINK ioctl command, set tun->dev->addr_len > > to match the appropriate type, using new tun_get_addr_len utility function &g

[PATCH] staging: rtl8723bs: remove unused variable from rtw_os_recv_indicate_pkt

2021-04-06 Thread Phillip Potter
test robot. Reported-by: kernel test robot Signed-off-by: Phillip Potter --- drivers/staging/rtl8723bs/os_dep/recv_linux.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c b/drivers/staging/rtl8723bs/os_dep/recv_linux.c index

[PATCH v2] net: tun: set tun->dev->addr_len during TUNSETLINK processing

2021-04-06 Thread Phillip Potter
om/bug?id=0766d38c656abeace60621896d705743aeefed51 Reported-by: syzbot+001516d86dbe88862...@syzkaller.appspotmail.com Signed-off-by: Phillip Potter --- V2: Removed inline specifier from tun_get_addr_len function. --- drivers/net/tun.c | 48 +++

Re: [PATCH] net: tun: set tun->dev->addr_len during TUNSETLINK processing

2021-04-06 Thread Phillip Potter
On Mon, Apr 05, 2021 at 02:59:21PM -0700, David Miller wrote: > From: Phillip Potter > Date: Mon, 5 Apr 2021 12:35:55 +0100 > > > When changing type with TUNSETLINK ioctl command, set tun->dev->addr_len > > to match the appropriate type, using new tun_get_addr_len

[PATCH] net: tun: set tun->dev->addr_len during TUNSETLINK processing

2021-04-05 Thread Phillip Potter
om/bug?id=0766d38c656abeace60621896d705743aeefed51 Reported-by: syzbot+001516d86dbe88862...@syzkaller.appspotmail.com Signed-off-by: Phillip Potter --- drivers/net/tun.c | 48 +++ 1 file changed, 48 insertions(+) diff --git a/drivers/net/tun.c b/drive

Re: [PATCH] net: initialize local variables in net/ipv6/mcast.c and net/ipv4/igmp.c

2021-04-03 Thread Phillip Potter
On Fri, Apr 02, 2021 at 11:12:36PM +0200, Eric Dumazet wrote: > > > On 4/2/21 10:53 PM, Eric Dumazet wrote: > > > > > > On 4/2/21 8:10 PM, Phillip Potter wrote: > >> On Fri, Apr 02, 2021 at 07:49:44PM +0200, Eric Dumazet wrote: > >>> >

Re: [PATCH] net: initialize local variables in net/ipv6/mcast.c and net/ipv4/igmp.c

2021-04-02 Thread Phillip Potter
On Fri, Apr 02, 2021 at 07:49:44PM +0200, Eric Dumazet wrote: > > > On 4/2/21 7:36 PM, Phillip Potter wrote: > > Use memset to initialize two local buffers in net/ipv6/mcast.c, > > and another in net/ipv4/igmp.c. Fixes a KMSAN found uninit-value > > bug repor

[PATCH] net: initialize local variables in net/ipv6/mcast.c and net/ipv4/igmp.c

2021-04-02 Thread Phillip Potter
...@syzkaller.appspotmail.com Signed-off-by: Phillip Potter --- net/ipv4/igmp.c | 2 ++ net/ipv6/mcast.c | 4 2 files changed, 6 insertions(+) diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 7b272bbed2b4..bc8e358a9a2a 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c @@ -1131,6 +1131,8 @@ static void

Re: [PATCH] zero-fill colormap in drivers/video/fbdev/core/fbcmap.c

2021-04-02 Thread Phillip Potter
On Thu, Apr 01, 2021 at 11:55:50AM +0200, Geert Uytterhoeven wrote: > On Thu, Apr 1, 2021 at 12:09 AM Phillip Potter wrote: > > Use kzalloc() rather than kmalloc() for the dynamically allocated parts > > of the colormap in fb_alloc_cmap_gfp, to prevent a leak of random

[PATCH 1/2] net: initialize local variables in net/ipv6/mcast.c and net/ipv4/igmp.c

2021-04-01 Thread Phillip Potter
...@syzkaller.appspotmail.com Signed-off-by: Phillip Potter --- net/ipv4/igmp.c | 2 ++ net/ipv6/mcast.c | 4 2 files changed, 6 insertions(+) diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 7b272bbed2b4..bc8e358a9a2a 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c @@ -1131,6 +1131,8 @@ static void

[PATCH] net: usb: ax88179_178a: initialize local variables before use

2021-04-01 Thread Phillip Potter
...@syzkaller.appspotmail.com Signed-off-by: Phillip Potter --- drivers/net/usb/ax88179_178a.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c index d650b39b6e5d..c1316718304d 100644 --- a/drivers/net/usb

[PATCH] zero-fill colormap in drivers/video/fbdev/core/fbcmap.c

2021-03-31 Thread Phillip Potter
=741578659feabd108ad9e06696f0c1f2e69c4b6e Reported-by: syzbot+47fa9c9c648b76530...@syzkaller.appspotmail.com Signed-off-by: Phillip Potter --- drivers/video/fbdev/core/fbcmap.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/core/fbcmap.c b/drivers/video/fbdev

Re: [PATCH 0/6] staging: rtl8723bs: remove DBG_COUNTER

2021-02-16 Thread Phillip Potter
On Tue, Feb 16, 2021 at 12:24:38PM +0300, Dan Carpenter wrote: > Looks good. > > Reviewed-by: Dan Carpenter > > regards, > dan carpenter > Thank you Dan. Regards, Phil

[PATCH 2/6] staging: rtl8723bs: remove DBG_COUNTER calls from os_dep/xmit_linux.c

2021-02-15 Thread Phillip Potter
Remove all DBG_COUNTER macro calls from os_dep/xmit_linux.c, as the corresponding variables are only ever written to and not used. This makes the code cleaner, and is necessary prior to removing the DBG_COUNTER definition itself. Signed-off-by: Phillip Potter --- drivers/staging/rtl8723bs

[PATCH 3/6] staging: rtl8723bs: remove DBG_COUNTER calls from core/rtw_xmit.c

2021-02-15 Thread Phillip Potter
Remove all DBG_COUNTER macro calls from core/rtw_xmit.c, as the corresponding variables are only ever written to and not used. This makes the code cleaner, and is necessary prior to removing the DBG_COUNTER definition itself. Signed-off-by: Phillip Potter --- drivers/staging/rtl8723bs/core

[PATCH 1/6] staging: rtl8723bs: remove DBG_COUNTER calls from os_dep/recv_linux.c

2021-02-15 Thread Phillip Potter
Remove all DBG_COUNTER macro calls from os_dep/recv_linux.c, as the corresponding variables are only ever written to and not used. This makes the code cleaner, and is necessary prior to removing the DBG_COUNTER definition itself. Signed-off-by: Phillip Potter --- drivers/staging/rtl8723bs

[PATCH 4/6] staging: rtl8723bs: remove DBG_COUNTER calls from core/rtw_recv.c

2021-02-15 Thread Phillip Potter
Remove all DBG_COUNTER macro calls from core/rtw_recv.c, as the corresponding variables are only ever written to and not used. This makes the code cleaner, and is necessary prior to removing the DBG_COUNTER definition itself. Signed-off-by: Phillip Potter --- drivers/staging/rtl8723bs/core

[PATCH 6/6] staging: rtl8723bs: remove rx_logs/tx_logs/int_logs from drv_types.h

2021-02-15 Thread Phillip Potter
the DBG_COUNTER macro, which has also been removed. Signed-off-by: Phillip Potter --- drivers/staging/rtl8723bs/include/drv_types.h | 131 -- 1 file changed, 131 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/drv_types.h b/drivers/staging/rtl8723bs/include/drv_types.h

[PATCH 5/6] staging: rtl8723bs: remove DBG_COUNTER definition from rtw_debug.h

2021-02-15 Thread Phillip Potter
Remove DBG_COUNTER macro definition from include/rtw_debug.h, as all uses of it have now been removed and it is no longer required. The DBG_COUNTER incremented values were never actually used anywhere else in the driver. Signed-off-by: Phillip Potter --- drivers/staging/rtl8723bs/include

[PATCH 0/6] staging: rtl8723bs: remove DBG_COUNTER

2021-02-15 Thread Phillip Potter
the codebase as well. These are inside a CONFIG_DBG_COUNTER preprocessor ifdef, and the only thing that was using them was the aforementioned DBG_COUNTER calls. Removing this code goes some way towards cleaning up this driver, and is therefore worth doing. Phillip Potter (6): staging: rtl8723bs

Re: [PATCH] staging: rtl8723bs: cleanup macros within include/rtw_debug.h

2021-02-10 Thread Phillip Potter
> > So I'm in the process of stripping out _dbgdump entirely as per Greg > > K-H's suggestion - am I to understand raw printk is frowned upon though, > > even with the correct KERN_x level specified? > > Yes. Ideally in drivers everything would use dev_dbg() and dev_err() or > whatever. But

Re: [PATCH] staging: rtl8723bs: cleanup macros within include/rtw_debug.h

2021-02-10 Thread Phillip Potter
On Wed, Feb 10, 2021 at 09:40:27PM +0300, Dan Carpenter wrote: > On Wed, Feb 10, 2021 at 05:00:03PM +0000, Phillip Potter wrote: > > Remove do/while loops from DBG_871X, MSG_8192C and DBG_8192C. > > I'm pretty hip to checkpatch.pl warnings, but I had forgotten wha

Re: [PATCH] staging: rtl8723bs: cleanup macros within include/rtw_debug.h

2021-02-10 Thread Phillip Potter
On Wed, Feb 10, 2021 at 06:12:54PM +0100, Greg KH wrote: > On Wed, Feb 10, 2021 at 05:00:03PM +0000, Phillip Potter wrote: > > Remove do/while loops from DBG_871X, MSG_8192C and DBG_8192C. Also > > fix opening brace placements and trailing single statement layout within > > R

[PATCH] staging: rtl8723bs: remove blank line from include/autoconf.h

2021-02-10 Thread Phillip Potter
Remove additional blank line from include/autoconf.h, fixes one checkpatch check notice. Signed-off-by: Phillip Potter --- drivers/staging/rtl8723bs/include/autoconf.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtl8723bs/include/autoconf.h b/drivers/staging/rtl8723bs

[PATCH] staging: rtl8723bs: cleanup macros within include/rtw_debug.h

2021-02-10 Thread Phillip Potter
definition. This fixes 3 checkpatch warnings, 5 checkpatch errors and 3 checkpatch checks. Signed-off-by: Phillip Potter --- drivers/staging/rtl8723bs/include/rtw_debug.h | 40 +-- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/drivers/staging/rtl8723bs/include

[PATCH] staging: rtl8723bs: remove typedefs from rtl8723b_recv.h

2021-02-09 Thread Phillip Potter
Remove typedefs from include/rtl8723b_recv.h and convert one usage in hal/rtl8723bs_recv.c to use the actual structure name in its pointer declaration. Fixes two checkpatch warnings. Signed-off-by: Phillip Potter --- drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c| 2 +- drivers/staging

[PATCH] staging: rtl8723bs: fix blank lines and comments in rtl8723b_hal.h

2021-02-09 Thread Phillip Potter
Remove unnecessary blank line, and move close of multiple-line comments to their own trailing lines. This fixes four checkpatch warnings and one checkpatch check notice for the include/rtl8723b_hal.h file. Signed-off-by: Phillip Potter --- drivers/staging/rtl8723bs/include/rtl8723b_hal.h | 13

[PATCH] staging: rtl8723bs: fix braces for os_dep/mlme_linux.c

2021-02-08 Thread Phillip Potter
Add braces to both branches of an if block for consistency, and also remove braces from a single line for loop. Fixes a checkpatch check and warning, thus clearing this file of any brace check/warning notices. Signed-off-by: Phillip Potter --- drivers/staging/rtl8723bs/os_dep/mlme_linux.c | 6

[PATCH] staging: rtl8723bs: remove braces from two single line if blocks

2021-02-08 Thread Phillip Potter
-off-by: Phillip Potter --- drivers/staging/rtl8723bs/include/rtw_mlme.h | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_mlme.h b/drivers/staging/rtl8723bs/include/rtw_mlme.h index ea0dd156051e..d8655cb619a1 100644 --- a/drivers/staging

Re: [PATCH] staging: octeon: remove braces from single-line block

2021-02-08 Thread Phillip Potter
On Mon, Feb 08, 2021 at 08:14:02AM +0100, Alexander Sverdlin wrote: > Hi! > > On 06/02/2021 21:17, Phillip Potter wrote: > > This removes the braces from the if statement that checks the > > physical node return value in cvm_oct_phy_setup_device, as this > > block

[PATCH] staging: rtl8192e: remove braces from single-line block

2021-02-07 Thread Phillip Potter
This removes the braces from the if statement that checks the wps_ie_len and ieee->wps_ie values in rtllib_association_req of rtllib_softmac.c as this block contains only one statement. Fixes a checkpatch warning. Signed-off-by: Phillip Potter --- drivers/staging/rtl8192e/rtllib_softmac.c

[PATCH] staging: rtl8192e: replace spaces with tab for a closing if brace

2021-02-07 Thread Phillip Potter
Remove spaces preceding closing brace of one of the nested if statement blocks inside the rtl92e_leisure_ps_leave function, and replace with a tab, to align it properly with the start of the block. Fixes a checkpatch warning. Signed-off-by: Phillip Potter --- drivers/staging/rtl8192e/rtl8192e

Re: [PATCH v2] staging: octeon: convert all uses of strlcpy to strscpy in ethernet-mdio.c

2021-02-07 Thread Phillip Potter
On Sun, Feb 07, 2021 at 04:35:06PM +0100, Greg KH wrote: > On Sun, Feb 07, 2021 at 03:13:20PM +0000, Phillip Potter wrote: > > Convert three calls to strlcpy inside the cvm_oct_get_drvinfo function > > to strscpy calls. As return values were not checked for these three > >

[PATCH v2] staging: octeon: convert all uses of strlcpy to strscpy in ethernet-mdio.c

2021-02-07 Thread Phillip Potter
Convert three calls to strlcpy inside the cvm_oct_get_drvinfo function to strscpy calls. As return values were not checked for these three calls before, change should be safe as functionality is equivalent. Signed-off-by: Phillip Potter --- v2: Modified changelog to take account of feedback

[PATCH v2] staging: octeon: convert all uses of strlcpy to strscpy in ethernet-mdio.c

2021-02-07 Thread Phillip Potter
Convert three calls to strlcpy inside the cvm_oct_get_drvinfo function to strscpy calls. As return values were not checked for these three calls before, change should be safe as functionality is equivalent. Signed-off-by: Phillip Potter --- drivers/staging/octeon/ethernet-mdio.c | 6 +++--- 1

[PATCH] staging: octeon: convert all uses of strlcpy to strscpy in ethernet-mdio.c

2021-02-07 Thread Phillip Potter
Convert three calls to strlcpy inside the cvm_oct_get_drvinfo function to strscpy calls. Fixes a style warning. Signed-off-by: Phillip Potter --- drivers/staging/octeon/ethernet-mdio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/octeon/ethernet

[PATCH] staging: octeon: remove braces from single-line block

2021-02-06 Thread Phillip Potter
This removes the braces from the if statement that checks the physical node return value in cvm_oct_phy_setup_device, as this block contains only one statement. Fixes a style warning. Signed-off-by: Phillip Potter --- drivers/staging/octeon/ethernet-mdio.c | 3 +-- 1 file changed, 1 insertion

Re: [RFC][PATCH v3 01/10] fs: common implementation of file type

2018-10-24 Thread Phillip Potter
On Wed, Oct 24, 2018 at 12:44:50PM +0300, Amir Goldstein wrote: > On Wed, Oct 24, 2018 at 12:31 PM Phillip Potter wrote: > > > > On Wed, Oct 24, 2018 at 12:20:14PM +0300, Amir Goldstein wrote: > > > On Wed, Oct 24, 2018 at 11:21 AM Phillip Potter > &

Re: [RFC][PATCH v3 01/10] fs: common implementation of file type

2018-10-24 Thread Phillip Potter
On Wed, Oct 24, 2018 at 12:44:50PM +0300, Amir Goldstein wrote: > On Wed, Oct 24, 2018 at 12:31 PM Phillip Potter wrote: > > > > On Wed, Oct 24, 2018 at 12:20:14PM +0300, Amir Goldstein wrote: > > > On Wed, Oct 24, 2018 at 11:21 AM Phillip Potter > &

Re: [RFC][PATCH v3 01/10] fs: common implementation of file type

2018-10-24 Thread Phillip Potter
On Wed, Oct 24, 2018 at 12:20:14PM +0300, Amir Goldstein wrote: > On Wed, Oct 24, 2018 at 11:21 AM Phillip Potter wrote: > > Dear Amir, > > > > Yes, I applied each patch manually to my tree, fixed it up where needed, > > then after rebuilding and testing each one I c

Re: [RFC][PATCH v3 01/10] fs: common implementation of file type

2018-10-24 Thread Phillip Potter
On Wed, Oct 24, 2018 at 12:20:14PM +0300, Amir Goldstein wrote: > On Wed, Oct 24, 2018 at 11:21 AM Phillip Potter wrote: > > Dear Amir, > > > > Yes, I applied each patch manually to my tree, fixed it up where needed, > > then after rebuilding and testing each one I c

Re: [RFC][PATCH v3 01/10] fs: common implementation of file type

2018-10-24 Thread Phillip Potter
On Wed, Oct 24, 2018 at 09:16:20AM +0300, Amir Goldstein wrote: > On Tue, Oct 23, 2018 at 11:19 PM Phillip Potter wrote: > > > > Many file systems use a copy implementation > > of dirent to on-disk file type conversions. > > > > Create a common implemen

Re: [RFC][PATCH v3 01/10] fs: common implementation of file type

2018-10-24 Thread Phillip Potter
On Wed, Oct 24, 2018 at 09:16:20AM +0300, Amir Goldstein wrote: > On Tue, Oct 23, 2018 at 11:19 PM Phillip Potter wrote: > > > > Many file systems use a copy implementation > > of dirent to on-disk file type conversions. > > > > Create a common implemen

[RFC][PATCH v2 04/10] ext2: use common file type conversion

2018-10-23 Thread Phillip Potter
Deduplicate the ext2 file type conversion implementation. Original patch by Amir Goldstein. v2: - Rebased against Linux 4.19 by Phillip Potter - This version does not remove EXT2_FT_x enum from fs/ext2/ext2.h, as these values are now used in compile-time checks added by Phillip Potter

[RFC][PATCH v2 04/10] ext2: use common file type conversion

2018-10-23 Thread Phillip Potter
Deduplicate the ext2 file type conversion implementation. Original patch by Amir Goldstein. v2: - Rebased against Linux 4.19 by Phillip Potter - This version does not remove EXT2_FT_x enum from fs/ext2/ext2.h, as these values are now used in compile-time checks added by Phillip Potter

[RFC][PATCH v2 08/10] f2fs: use common file type conversion

2018-10-23 Thread Phillip Potter
Deduplicate the f2fs file type conversion implementation. Original patch by Amir Goldstein. v2: - Rebased against Linux 4.19 by Phillip Potter - Compile-time checks added by Phillip Potter to make sure the F2FS_FT_x enum values stay same as FT_x values v1: - Initial implementation Signed-off

[RFC][PATCH 03/10] hfsplus: use fs_umode_to_dtype() helper

2018-10-23 Thread Phillip Potter
Replace if/else statements with common lookup table implementation. Original patch written by Amir Goldstein. Signed-off-by: Phillip Potter --- fs/hfsplus/dir.c | 16 ++-- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c index

[RFC][PATCH v3 01/10] fs: common implementation of file type

2018-10-23 Thread Phillip Potter
: - Rebased against Linux 4.19 by Phillip Potter - Added SPDX tag to new include/linux/file_type.h - Added include/linux/file_type.h to MAINTAINERS v2: - s/DT_MASK/S_DT_MASK to fix redefinition in drivers/scsi/qla2xxx/qla_def.h - Explicit initialization of fs_dtype_by_ftype[] using [FT_*] = DT_* v1

[RFC][PATCH v2 09/10] nilfs2: use common file type conversion

2018-10-23 Thread Phillip Potter
Deduplicate the nilfs2 file type conversion implementation. Original patch by Amir Goldstein. v2: - Compile-time checks added by Phillip Potter to make sure the NILFS_FT_x enum values stay same as FT_x values v1: - Initial implementation Signed-off-by: Phillip Potter --- fs/nilfs2/dir.c

[RFC][PATCH 02/10] ufs: use fs_umode_to_dtype() helper

2018-10-23 Thread Phillip Potter
Replace switch statement with common lookup table implementation. Original patch written by Amir Goldstein. Signed-off-by: Phillip Potter --- fs/ufs/util.h | 29 + 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/fs/ufs/util.h b/fs/ufs/util.h index

[RFC][PATCH v2 08/10] f2fs: use common file type conversion

2018-10-23 Thread Phillip Potter
Deduplicate the f2fs file type conversion implementation. Original patch by Amir Goldstein. v2: - Rebased against Linux 4.19 by Phillip Potter - Compile-time checks added by Phillip Potter to make sure the F2FS_FT_x enum values stay same as FT_x values v1: - Initial implementation Signed-off

[RFC][PATCH 03/10] hfsplus: use fs_umode_to_dtype() helper

2018-10-23 Thread Phillip Potter
Replace if/else statements with common lookup table implementation. Original patch written by Amir Goldstein. Signed-off-by: Phillip Potter --- fs/hfsplus/dir.c | 16 ++-- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c index

[RFC][PATCH v3 01/10] fs: common implementation of file type

2018-10-23 Thread Phillip Potter
: - Rebased against Linux 4.19 by Phillip Potter - Added SPDX tag to new include/linux/file_type.h - Added include/linux/file_type.h to MAINTAINERS v2: - s/DT_MASK/S_DT_MASK to fix redefinition in drivers/scsi/qla2xxx/qla_def.h - Explicit initialization of fs_dtype_by_ftype[] using [FT_*] = DT_* v1

[RFC][PATCH v2 09/10] nilfs2: use common file type conversion

2018-10-23 Thread Phillip Potter
Deduplicate the nilfs2 file type conversion implementation. Original patch by Amir Goldstein. v2: - Compile-time checks added by Phillip Potter to make sure the NILFS_FT_x enum values stay same as FT_x values v1: - Initial implementation Signed-off-by: Phillip Potter --- fs/nilfs2/dir.c

[RFC][PATCH 02/10] ufs: use fs_umode_to_dtype() helper

2018-10-23 Thread Phillip Potter
Replace switch statement with common lookup table implementation. Original patch written by Amir Goldstein. Signed-off-by: Phillip Potter --- fs/ufs/util.h | 29 + 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/fs/ufs/util.h b/fs/ufs/util.h index

[RFC][PATCH 00/11] common implementation of dirent file types

2018-10-23 Thread Phillip Potter
. I hope the various subsystem/fs maintainers will see fit to accept this work also. Phillip Potter (10): fs: common implementation of file type conversions ufs: use fs_umode_to_dtype() helper hfsplus: use fs_umode_to_dtype() helper ext2: use common file type conversion exofs: use common

[RFC][PATCH 00/11] common implementation of dirent file types

2018-10-23 Thread Phillip Potter
. I hope the various subsystem/fs maintainers will see fit to accept this work also. Phillip Potter (10): fs: common implementation of file type conversions ufs: use fs_umode_to_dtype() helper hfsplus: use fs_umode_to_dtype() helper ext2: use common file type conversion exofs: use common

[RFC][PATCH v2 05/10] exofs: use common file type conversion

2018-10-23 Thread Phillip Potter
Deduplicate the exofs file type conversion implementation. Original patch by Amir Goldstein. v2: - This version does not remove EXOFS_FT_x enum from fs/exofs/common.h, as these values are now used in compile-time checks added by Phillip Potter to make sure they remain the same as FT_x values

[RFC][PATCH v2 05/10] exofs: use common file type conversion

2018-10-23 Thread Phillip Potter
Deduplicate the exofs file type conversion implementation. Original patch by Amir Goldstein. v2: - This version does not remove EXOFS_FT_x enum from fs/exofs/common.h, as these values are now used in compile-time checks added by Phillip Potter to make sure they remain the same as FT_x values

[RFC][PATCH v2 06/10] ext4: use common file type conversion

2018-10-23 Thread Phillip Potter
Deduplicate the ext4 file type conversion implementation. Original patch by Amir Goldstein. v2: - Rebased against Linux 4.19 by Phillip Potter - This version does not replace the EXT4_FT_x defines from fs/ext4/ext4.h, as these values are now used in compile-time checks added by Phillip

[RFC][PATCH v2 04/10] ext2: use common file type conversion

2018-10-23 Thread Phillip Potter
Deduplicate the ext2 file type conversion implementation. Original patch by Amir Goldstein. v2: - Rebased against Linux 4.19 by Phillip Potter - This version does not remove EXT2_FT_x enum from fs/ext2/ext2.h, as these values are now used in compile-time checks added by Phillip Potter

[RFC][PATCH v2 06/10] ext4: use common file type conversion

2018-10-23 Thread Phillip Potter
Deduplicate the ext4 file type conversion implementation. Original patch by Amir Goldstein. v2: - Rebased against Linux 4.19 by Phillip Potter - This version does not replace the EXT4_FT_x defines from fs/ext4/ext4.h, as these values are now used in compile-time checks added by Phillip

[RFC][PATCH v2 04/10] ext2: use common file type conversion

2018-10-23 Thread Phillip Potter
Deduplicate the ext2 file type conversion implementation. Original patch by Amir Goldstein. v2: - Rebased against Linux 4.19 by Phillip Potter - This version does not remove EXT2_FT_x enum from fs/ext2/ext2.h, as these values are now used in compile-time checks added by Phillip Potter

Re: [PATCH] fs: ufs: Remove switch statement from ufs_set_de_type function

2018-10-22 Thread Phillip Potter
On Sun, Oct 21, 2018 at 02:02:57PM +0300, Amir Goldstein wrote: > Yes. If you are looking for a cleanup task, you can > apply relevant patches from my series, starting with: > https://patchwork.kernel.org/patch/9481237/ > (Leave the xfs patch [11/11] out) > > But besides verifying that patches

Re: [PATCH] fs: ufs: Remove switch statement from ufs_set_de_type function

2018-10-22 Thread Phillip Potter
On Sun, Oct 21, 2018 at 02:02:57PM +0300, Amir Goldstein wrote: > Yes. If you are looking for a cleanup task, you can > apply relevant patches from my series, starting with: > https://patchwork.kernel.org/patch/9481237/ > (Leave the xfs patch [11/11] out) > > But besides verifying that patches

Re: [PATCH] fs: ufs: Remove switch statement from ufs_set_de_type function

2018-10-21 Thread Phillip Potter
On Sun, Oct 21, 2018 at 08:30:35AM +0300, Amir Goldstein wrote: > On Sun, Oct 21, 2018 at 1:27 AM Matthew Wilcox wrote: > > > > On Sat, Oct 20, 2018 at 11:09:57PM +0100, Phillip Potter wrote: > > > Remove switch statement from ufs_set_de_type function in fs/ufs/util.h

Re: [PATCH] fs: ufs: Remove switch statement from ufs_set_de_type function

2018-10-21 Thread Phillip Potter
On Sun, Oct 21, 2018 at 08:30:35AM +0300, Amir Goldstein wrote: > On Sun, Oct 21, 2018 at 1:27 AM Matthew Wilcox wrote: > > > > On Sat, Oct 20, 2018 at 11:09:57PM +0100, Phillip Potter wrote: > > > Remove switch statement from ufs_set_de_type function in fs/ufs/util.h

[PATCH] fs: ufs: Remove switch statement from ufs_set_de_type function

2018-10-20 Thread Phillip Potter
tibility reasons, the relation between S_IFx and DT_x will not change. For cases where the mode is invalid, upper layer validation catches this anyway, so this improves readability and arguably performance by assigning (mode & S_IFMT) >> 12 directly without any jump table or conditional logic. Sig

[PATCH] fs: ufs: Remove switch statement from ufs_set_de_type function

2018-10-20 Thread Phillip Potter
tibility reasons, the relation between S_IFx and DT_x will not change. For cases where the mode is invalid, upper layer validation catches this anyway, so this improves readability and arguably performance by assigning (mode & S_IFMT) >> 12 directly without any jump table or conditional logic. Sig

Re: [PATCH] fs: ufs: Remove switch statement from ufs_set_de_type function

2018-10-18 Thread Phillip Potter
On Thu, Oct 18, 2018 at 12:33:05AM +0100, Al Viro wrote: > They are. BSD folks had (sanely, IMO) put the 'type' bits of st_mode > into directory entry verbatim. Again, "symbolic constant" != "can be > expected to change"... If, e.g., some port decides to change S_IFIFO, > they'll have no end of

Re: [PATCH] fs: ufs: Remove switch statement from ufs_set_de_type function

2018-10-18 Thread Phillip Potter
On Thu, Oct 18, 2018 at 12:33:05AM +0100, Al Viro wrote: > They are. BSD folks had (sanely, IMO) put the 'type' bits of st_mode > into directory entry verbatim. Again, "symbolic constant" != "can be > expected to change"... If, e.g., some port decides to change S_IFIFO, > they'll have no end of

[PATCH] fs: ufs: Remove switch statement from ufs_set_de_type function

2018-10-17 Thread Phillip Potter
ILD_BUG_ON macro calls. For invalid cases, upper layer validation catches this anyway, so this improves readability and arguably performance by assigning (mode & S_IFMT) >> 12 directly. Signed-off-by: Phillip Potter --- fs/ufs/util.h | 39 +++ 1 file cha

[PATCH] fs: ufs: Remove switch statement from ufs_set_de_type function

2018-10-17 Thread Phillip Potter
ILD_BUG_ON macro calls. For invalid cases, upper layer validation catches this anyway, so this improves readability and arguably performance by assigning (mode & S_IFMT) >> 12 directly. Signed-off-by: Phillip Potter --- fs/ufs/util.h | 39 +++ 1 file cha

[PATCH] fs: ufs: Remove switch statement from ufs_set_de_type function

2018-10-17 Thread Phillip Potter
ches this anyway, so this improves readability and arguably performance by assigning (mode & S_IFMT) >> 12 directly. Signed-off-by: Phillip Potter --- fs/ufs/util.h | 30 ++ 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/fs/ufs/util.h b/fs/ufs

[PATCH] fs: ufs: Remove switch statement from ufs_set_de_type function

2018-10-17 Thread Phillip Potter
ches this anyway, so this improves readability and arguably performance by assigning (mode & S_IFMT) >> 12 directly. Signed-off-by: Phillip Potter --- fs/ufs/util.h | 30 ++ 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/fs/ufs/util.h b/fs/ufs

[PATCH] fs: ufs: Remove switch statement from ufs_set_de_type function

2018-10-09 Thread Phillip Potter
ches this anyway, so this improves readability and arguably performance by assigning (mode & S_IFMT) >> 12 directly. Signed-off-by: Phillip Potter --- fs/ufs/util.h | 30 ++ 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/fs/ufs/util.h b/fs/ufs

[PATCH] fs: ufs: Remove switch statement from ufs_set_de_type function

2018-10-09 Thread Phillip Potter
ches this anyway, so this improves readability and arguably performance by assigning (mode & S_IFMT) >> 12 directly. Signed-off-by: Phillip Potter --- fs/ufs/util.h | 30 ++ 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/fs/ufs/util.h b/fs/ufs

[PATCH] fs: ufs: Remove switch statement from ufs_set_de_type function

2018-10-02 Thread Phillip Potter
ches this anyway, so this improves readability and arguably performance by assigning (mode & S_IFMT) >> 12 directly. Signed-off-by: Phillip Potter --- fs/ufs/util.h | 30 ++ 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/fs/ufs/util.h b/fs/ufs

[PATCH] fs: ufs: Remove switch statement from ufs_set_de_type function

2018-10-02 Thread Phillip Potter
ches this anyway, so this improves readability and arguably performance by assigning (mode & S_IFMT) >> 12 directly. Signed-off-by: Phillip Potter --- fs/ufs/util.h | 30 ++ 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/fs/ufs/util.h b/fs/ufs

Re: [PATCH] fs: ufs: Convert ufs_set_de_type to use lookup table

2018-10-02 Thread Phillip Potter
On Tue, Oct 02, 2018 at 03:28:14AM +0100, Al Viro wrote: > On Mon, Oct 01, 2018 at 04:33:10PM +0100, Phillip Potter wrote: > > Modify ufs_set_de_type function in fs/ufs/util.h to use a lookup > > table rather than a switch statement, as per the TODO comment. > > Brittle, tha

Re: [PATCH] fs: ufs: Convert ufs_set_de_type to use lookup table

2018-10-02 Thread Phillip Potter
On Tue, Oct 02, 2018 at 03:28:14AM +0100, Al Viro wrote: > On Mon, Oct 01, 2018 at 04:33:10PM +0100, Phillip Potter wrote: > > Modify ufs_set_de_type function in fs/ufs/util.h to use a lookup > > table rather than a switch statement, as per the TODO comment. > > Brittle, tha

[PATCH] fs: ufs: Convert ufs_set_de_type to use lookup table

2018-10-01 Thread Phillip Potter
Modify ufs_set_de_type function in fs/ufs/util.h to use a lookup table rather than a switch statement, as per the TODO comment. Signed-off-by: Phillip Potter --- diff --git a/fs/ufs/util.h b/fs/ufs/util.h index 1907be6d5808..1edf4c6454e3 100644 --- a/fs/ufs/util.h +++ b/fs/ufs/util.h @@ -155,37

[PATCH] fs: ufs: Convert ufs_set_de_type to use lookup table

2018-10-01 Thread Phillip Potter
Modify ufs_set_de_type function in fs/ufs/util.h to use a lookup table rather than a switch statement, as per the TODO comment. Signed-off-by: Phillip Potter --- diff --git a/fs/ufs/util.h b/fs/ufs/util.h index 1907be6d5808..1edf4c6454e3 100644 --- a/fs/ufs/util.h +++ b/fs/ufs/util.h @@ -155,37

[PATCH] fs: ufs: Convert ufs_set_de_type to use lookup table

2018-04-03 Thread Phillip Potter
Modify ufs_set_de_type function in fs/ufs/util.h to use a lookup table rather than a switch statement, as per the TODO comment. Signed-off-by: Phillip Potter <p...@philpotter.co.uk> --- fs/ufs/util.h | 50 ++ 1 file changed, 22 insertions(

[PATCH] fs: ufs: Convert ufs_set_de_type to use lookup table

2018-04-03 Thread Phillip Potter
Modify ufs_set_de_type function in fs/ufs/util.h to use a lookup table rather than a switch statement, as per the TODO comment. Signed-off-by: Phillip Potter --- fs/ufs/util.h | 50 ++ 1 file changed, 22 insertions(+), 28 deletions(-) diff --git

[PATCH] fs: ufs: Convert ufs_set_de_type to use lookup table

2018-03-18 Thread Phillip Potter
Modify ufs_set_de_type function in fs/ufs/util.h to use a lookup table rather than a switch statement, as per the TODO comment. Signed-off-by: Phillip Potter <p...@philpotter.co.uk> --- fs/ufs/util.h | 50 ++ 1 file changed, 22 insertions(

[PATCH] fs: ufs: Convert ufs_set_de_type to use lookup table

2018-03-18 Thread Phillip Potter
Modify ufs_set_de_type function in fs/ufs/util.h to use a lookup table rather than a switch statement, as per the TODO comment. Signed-off-by: Phillip Potter --- fs/ufs/util.h | 50 ++ 1 file changed, 22 insertions(+), 28 deletions(-) diff --git

[PATCH] fs: ufs: small comment fix

2017-04-26 Thread Phillip Potter
Fixes a small style error in comment of s_u2_dsize member of struct ufs_sb_private_info definition in fs/ufs/ufs_fs.h Signed-off-by: Phillip Potter <p...@philpotter.co.uk> --- --- a/fs/ufs/ufs_fs.h 2017-04-16 21:00:18.0 +0100 +++ b/fs/ufs/ufs_fs.h 2017-04-20 10:19:32.272298138

[PATCH] fs: ufs: small comment fix

2017-04-26 Thread Phillip Potter
Fixes a small style error in comment of s_u2_dsize member of struct ufs_sb_private_info definition in fs/ufs/ufs_fs.h Signed-off-by: Phillip Potter --- --- a/fs/ufs/ufs_fs.h 2017-04-16 21:00:18.0 +0100 +++ b/fs/ufs/ufs_fs.h 2017-04-20 10:19:32.272298138 +0100 @@ -736,7 +736,7