Re: [f2fs-dev] [man-pages PATCH v3] statx.2, open.2: document STATX_DIOALIGN

2022-10-06 Thread Darrick J. Wong
On Tue, Oct 04, 2022 at 10:43:07AM -0700, Eric Biggers wrote: > From: Eric Biggers > > Document the STATX_DIOALIGN support for statx() > (https://git.kernel.org/linus/725737e7c21d2d25). > > Reviewed-by: Darrick J. Wong > Signed-off-by: Eric Biggers > --- > > I'm resending this now that

Re: [f2fs-dev] [PATCH v4 2/2] f2fs: introduce F2FS_IOC_START_ATOMIC_REPLACE

2022-10-06 Thread Darrick J. Wong
On Thu, Oct 06, 2022 at 01:33:34AM -0700, Christoph Hellwig wrote: > On Tue, Oct 04, 2022 at 10:13:51AM -0700, Daeho Jeong wrote: > > From: Daeho Jeong > > > > introduce a new ioctl to replace the whole content of a file atomically, > > which means it induces truncate and content update at the

Re: [f2fs-dev] [PATCH] mkfs.f2fs: update allocation policy for ro feature

2022-10-06 Thread Chao Yu
On 2022/10/3 9:06, Jaegeuk Kim wrote: On 10/01, Chao Yu wrote: On 2022/10/1 6:33, Jaegeuk Kim wrote: On 09/30, Chao Yu wrote: On 2022/9/30 2:27, Jaegeuk Kim wrote: On 09/28, Chao Yu wrote: On 2022/9/28 11:15, Jaegeuk Kim wrote: On 09/28, Chao Yu wrote: On 2022/9/28 0:40, Jaegeuk Kim

[f2fs-dev] [PATCH 2/2] fsck.f2fs: trigger repairing if filesystem has inconsistent errors

2022-10-06 Thread Chao Yu
In auto/preen mode, let's trigger repairing if filesystem has inconsistent errors. Signed-off-by: Chao Yu --- fsck/fsck.c | 8 ++-- fsck/fsck.h | 1 + fsck/mount.c | 52 ++- include/f2fs_fs.h | 26 +++- 4

[f2fs-dev] [PATCH 1/2] fsck.f2fs: trigger repairing if filesystem was forced to stop

2022-10-06 Thread Chao Yu
In auto/preen mode, let's trigger repairing if filesystem was forced to stop. Signed-off-by: Chao Yu --- fsck/fsck.c | 7 +++ fsck/fsck.h | 1 + fsck/mount.c | 47 +++ include/f2fs_fs.h | 19 ++- 4 files changed,

[f2fs-dev] [PATCH 1/2] mkfs.f2fs: update allocation policy for ro feature

2022-10-06 Thread Chao Yu
Update allocation policy for ro feature: - hot_data: allocating blocks by LBA ascending order - hot_node: allocating blocks by LBA descending order Signed-off-by: Chao Yu --- fsck/mount.c | 8 fsck/segment.c | 15 ++- mkfs/f2fs_format.c | 4 ++-- 3 files

[f2fs-dev] [PATCH 2/2] fsck.f2fs: export valid image size

2022-10-06 Thread Chao Yu
Change to calculate and export max image size with valid blocks used of image rather than last used block of image. [FSCK] Max image size: xx MB, Free space: xx MB Signed-off-by: Chao Yu --- fsck/f2fs.h | 2 ++ fsck/fsck.c | 15 +++ include/f2fs_fs.h | 1 -

[f2fs-dev] [PATCH] fsck.f2fs: fix __end_block_addr()

2022-10-06 Thread Chao Yu
The calculation is wrong, fix it. Signed-off-by: Chao Yu --- fsck/f2fs.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fsck/f2fs.h b/fsck/f2fs.h index 030d750..2fd241f 100644 --- a/fsck/f2fs.h +++ b/fsck/f2fs.h @@ -416,8 +416,9 @@ static inline block_t

[f2fs-dev] [PATCH] f2fs: fix compile warning

2022-10-06 Thread Chao Yu
fs/f2fs/super.c:3886:6: warning: no previous prototype for 'f2fs_record_stop_reason' [-Wmissing-prototypes] Signed-off-by: Chao Yu --- fs/f2fs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index fad333881ea2..2908d41ed462 100644

[f2fs-dev] [PATCH] f2fs: support fault injection for f2fs_is_valid_blkaddr()

2022-10-06 Thread Chao Yu
This patch supports to inject fault into f2fs_is_valid_blkaddr() to simulate accessing inconsistent data/meta block addressses from caller. Usage: a) echo 262144 > /sys/fs/f2fs//inject_type or b) mount -o fault_type=262144 Signed-off-by: Chao Yu --- Documentation/filesystems/f2fs.rst | 1 +

Re: [f2fs-dev] [PATCH v1 0/5] treewide cleanup of random integer usage

2022-10-06 Thread Jason A. Donenfeld via Linux-f2fs-devel
A v2 that won't murder your mail setup is now available here: https://lore.kernel.org/lkml/20221006132510.23374-1-ja...@zx2c4.com/ Please do not (attempt to) post more replies to v1, as it kicks up a storm of angry MTAs. ___ Linux-f2fs-devel mailing

Re: [f2fs-dev] [PATCH v1 1/5] treewide: use prandom_u32_max() when possible

2022-10-06 Thread Jason Gunthorpe
On Thu, Oct 06, 2022 at 06:45:25AM -0600, Jason A. Donenfeld wrote: > Hi Kees, > > On Wed, Oct 05, 2022 at 09:16:50PM -0700, Kees Cook wrote: > > On Wed, Oct 05, 2022 at 11:48:40PM +0200, Jason A. Donenfeld wrote: > > > Rather than incurring a division or requesting too many random bytes for > >

Re: [f2fs-dev] [PATCH v1 3/5] treewide: use get_random_u32() when possible

2022-10-06 Thread Jason Gunthorpe
On Wed, Oct 05, 2022 at 11:48:42PM +0200, Jason A. Donenfeld wrote: > index 14392c942f49..499a425a3379 100644 > --- a/drivers/infiniband/hw/cxgb4/cm.c > +++ b/drivers/infiniband/hw/cxgb4/cm.c > @@ -734,7 +734,7 @@ static int send_connect(struct c4iw_ep *ep) >

Re: [f2fs-dev] [PATCH v1 3/5] treewide: use get_random_u32() when possible

2022-10-06 Thread Andy Shevchenko
On Thu, Oct 06, 2022 at 07:05:48AM -0600, Jason A. Donenfeld wrote: > On Thu, Oct 6, 2022 at 6:47 AM Jason Gunthorpe wrote: > > On Wed, Oct 05, 2022 at 11:48:42PM +0200, Jason A. Donenfeld wrote: ... > > > - u32 isn = (prandom_u32() & ~7UL) - 1; > > > + u32 isn = (get_random_u32() &

Re: [f2fs-dev] [PATCH v1 3/5] treewide: use get_random_u32() when possible

2022-10-06 Thread Jason Gunthorpe
On Thu, Oct 06, 2022 at 07:05:48AM -0600, Jason A. Donenfeld wrote: > > > diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c > > > b/drivers/infiniband/ulp/ipoib/ipoib_cm.c > > > index fd9d7f2c4d64..a605cf66b83e 100644 > > > --- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c > > > +++

Re: [f2fs-dev] [PATCH v1 3/5] treewide: use get_random_u32() when possible

2022-10-06 Thread Jason A. Donenfeld via Linux-f2fs-devel
On Thu, Oct 6, 2022 at 7:01 AM Andy Shevchenko wrote: > > On Thu, Oct 06, 2022 at 06:33:15AM -0600, Jason A. Donenfeld wrote: > > On Thu, Oct 06, 2022 at 10:43:31AM +0200, Jan Kara wrote: > > ... > > > > The code here is effectively doing the > > > > > > parent_group =

Re: [f2fs-dev] [PATCH v1 3/5] treewide: use get_random_u32() when possible

2022-10-06 Thread Jason A. Donenfeld via Linux-f2fs-devel
On Thu, Oct 6, 2022 at 6:47 AM Jason Gunthorpe wrote: > > On Wed, Oct 05, 2022 at 11:48:42PM +0200, Jason A. Donenfeld wrote: > > > index 14392c942f49..499a425a3379 100644 > > --- a/drivers/infiniband/hw/cxgb4/cm.c > > +++ b/drivers/infiniband/hw/cxgb4/cm.c > > @@ -734,7 +734,7 @@ static int

Re: [f2fs-dev] [PATCH v1 1/5] treewide: use prandom_u32_max() when possible

2022-10-06 Thread Andy Shevchenko
On Thu, Oct 06, 2022 at 09:55:19AM -0300, Jason Gunthorpe wrote: > On Thu, Oct 06, 2022 at 06:45:25AM -0600, Jason A. Donenfeld wrote: > > On Wed, Oct 05, 2022 at 09:16:50PM -0700, Kees Cook wrote: > > > On Wed, Oct 05, 2022 at 11:48:40PM +0200, Jason A. Donenfeld wrote: > > > > Rather than

Re: [f2fs-dev] [PATCH v1 3/5] treewide: use get_random_u32() when possible

2022-10-06 Thread Andy Shevchenko
On Thu, Oct 06, 2022 at 06:33:15AM -0600, Jason A. Donenfeld wrote: > On Thu, Oct 06, 2022 at 10:43:31AM +0200, Jan Kara wrote: ... > > The code here is effectively doing the > > > > parent_group = prandom_u32_max(ngroups); > > > > Similarly here we can use prandom_u32_max(ngroups) like: >

Re: [f2fs-dev] [PATCH v1 0/5] treewide cleanup of random integer usage

2022-10-06 Thread Jason A. Donenfeld via Linux-f2fs-devel
On Wed, Oct 05, 2022 at 09:55:43PM -0700, Kees Cook wrote: > It'd be nice to capture some (all?) of the above somewhere. Perhaps just > a massive comment in the header? I'll include (something like) this in some "how to use" documentation I'm working on separately. > > I've CC'd

Re: [f2fs-dev] [PATCH v1 1/5] treewide: use prandom_u32_max() when possible

2022-10-06 Thread Jason A. Donenfeld via Linux-f2fs-devel
Hi Kees, On Wed, Oct 05, 2022 at 09:16:50PM -0700, Kees Cook wrote: > On Wed, Oct 05, 2022 at 11:48:40PM +0200, Jason A. Donenfeld wrote: > > Rather than incurring a division or requesting too many random bytes for > > the given range, use the prandom_u32_max() function, which only takes > > the

Re: [f2fs-dev] [PATCH v1 3/5] treewide: use get_random_u32() when possible

2022-10-06 Thread Jason A. Donenfeld via Linux-f2fs-devel
On Thu, Oct 06, 2022 at 10:43:31AM +0200, Jan Kara wrote: > The code here is effectively doing the > > parent_group = prandom_u32_max(ngroups); > > Similarly here we can use prandom_u32_max(ngroups) like: > > if (qstr) { > ... >

Re: [f2fs-dev] [PATCH v1 2/5] treewide: use get_random_{u8, u16}() when possible

2022-10-06 Thread Jason A. Donenfeld via Linux-f2fs-devel
On Wed, Oct 05, 2022 at 09:38:02PM -0700, Kees Cook wrote: > > diff --git a/lib/test_vmalloc.c b/lib/test_vmalloc.c > > index 56ffaa8dd3f6..0131ed2cd1bd 100644 > > --- a/lib/test_vmalloc.c > > +++ b/lib/test_vmalloc.c > > @@ -80,7 +80,7 @@ static int random_size_align_alloc_test(void) > > int

Re: [f2fs-dev] [PATCH v1 3/5] treewide: use get_random_u32() when possible

2022-10-06 Thread Jan Kara
On Wed 05-10-22 23:48:42, Jason A. Donenfeld wrote: > The prandom_u32() function has been a deprecated inline wrapper around > get_random_u32() for several releases now, and compiles down to the > exact same code. Replace the deprecated wrapper with a direct call to > the real function. > >

Re: [f2fs-dev] [PATCH v4 2/2] f2fs: introduce F2FS_IOC_START_ATOMIC_REPLACE

2022-10-06 Thread Christoph Hellwig
On Tue, Oct 04, 2022 at 10:13:51AM -0700, Daeho Jeong wrote: > From: Daeho Jeong > > introduce a new ioctl to replace the whole content of a file atomically, > which means it induces truncate and content update at the same time. > We can start it with F2FS_IOC_START_ATOMIC_REPLACE and complete