On Fri, 25 Aug 2023 18:41:38, c...@kernel.org wrote:
> Can you please check below patch? it has fixed reported issue.
>
> https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/commit/?h=dev&id=5c13e2388bf3426fd69a89eb46e50469e9624e56
>
> Feedback from syzbot:
>
> https://lore.kernel.or
On Fri, Aug 25, 2023 at 03:47:56PM +0200, Jan Kara wrote:
> I can see the appeal of not having to introduce the new bdev_handle type
> and just using struct file which unifies in-kernel and userspace block
> device opens. But I can see downsides too - the last fput() happening from
> task work mak
On Fri, Aug 25, 2023 at 09:54:02PM +0800, Hao Xu wrote:
> From: Hao Xu
>
> This series introduce getdents64 to io_uring, the code logic is similar
> with the snychronized version's. It first try nowait issue, and offload
> it to io-wq threads if the first try fails.
>
> Patch1 and Patch2 are som
This converts inodes, direct nodes, and indirect nodes over to not being
based on a 4K page size. f2fs_inode's i_nids field should now be
accessed via a macro, as it's location depends on block size.
Access to direct nodes and indirect nodes is unchanged.
The node footer's location is also based
This splits off access to the summary block's journal and footer into a
macro call, as their location is dependent on block size. Because of
this you should use F2FS_BLKSIZE instead of sizeof(struct summary_block)
Signed-off-by: Daniel Rosenberg
---
fsck/f2fs.h| 4 +--
fsck/fsck.c
This adds support for 4K and 16K block size using the same binary.
mkfs can choose block size via the -b option, with other tools getting
the blocksize from the superblock.
On mount time, we can't rely on block size for the location for the
superblock, since that information is in the superblock.
This converts the various block size based constants to be defined in
terms of the block size. This makes it possible to change the block size
by changing only F2FS_BLKSIZE_BITS in f2fs_fs.h
Signed-off-by: Daniel Rosenberg
---
fsck/dir.c | 2 +-
fsck/dump.c | 4 +-
f
On Fri, Aug 25, 2023 at 10:39 AM Jaegeuk Kim wrote:
>
> Hi Daniel,
>
> f2fs_format_main.c: In function ‘add_default_options’:
> f2fs_format_main.c:142:41: error: ‘struct f2fs_configuration’ has no member
> named ‘blksize’
> 142 | c.wanted_sector_size = c.blksize;
> |
This moves access to f2fs_dentry_block's dentry list and filename list
behind a macro, as their locations depend on block size.
Since struct f2fs_dentry_block no longer represents the full block, use
F2FS_BLKSIZE instead of sizeof(struct f2fs_dentry_block)
Signed-off-by: Daniel Rosenberg
---
fs
This splits off access to the orphan block's footer into a macro call
as its location is dependent on block size. Because of this, you should
use F2FS_BLKSIZE instead of sizeof(struct f2fs_orphan_block)
Signed-off-by: Daniel Rosenberg
---
fsck/fsck.c | 4 ++--
fsck/main.c | 1 +
in
This converts f2fs_nat_block and f2fs_sit_block to be variable length
arrays. This does not change the way they are accessed, but removes a
misleading statment that these sizes are fixed, as opposed to deriving
from F2FS_BLKSIZE
Signed-off-by: Daniel Rosenberg
---
include/f2fs_fs.h | 20
This adds support for different block sizes to f2fs-tools.
The first patch redefines all block size based constants to be based on the
block size. After this patch, you should be able to compile a version of
f2fs-tools that works for a given blocksize by just setting F2FS_BLKSIZE_BITS
in f2fs_fs.h
On Fri, Aug 25, 2023 at 09:54:27PM +0800, Hao Xu wrote:
> From: Hao Xu
>
> support nowait for xfs_buf_item_init() and error out -EAGAIN to
> _xfs_trans_bjoin() when it would block.
>
> Signed-off-by: Hao Xu
> ---
> fs/xfs/xfs_buf_item.c | 9 +++--
> fs/xfs/xfs_buf_item.h |
On Fri, Aug 25, 2023 at 09:54:26PM +0800, Hao Xu wrote:
> From: Hao Xu
>
> This causes xfstests generic/232 hung in umount process, waiting for ail
> push, so I comment it for now, need some hints from xfs folks.
> Not a real patch.
>
> Signed-off-by: Hao Xu
> ---
> fs/xfs/xfs_buf.c | 7 ++
On Fri, Aug 25, 2023 at 09:54:30PM +0800, Hao Xu wrote:
> From: Hao Xu
>
> Apply trylock logic for xc_ctx_lock in xlog_cil_commit() in nowait
> case and error out -EAGAIN for xlog_cil_commit().
Again, fundamentally broken. Any error from xlog_cil_commit() will
result in a filesystem shutdown as
On Fri, Aug 25, 2023 at 09:54:28PM +0800, Hao Xu wrote:
> From: Hao Xu
>
> if the log transaction is a sync one, let's fail the nowait try and
> return -EAGAIN directly since sync transaction means blocked by IO.
>
> Signed-off-by: Hao Xu
> ---
> fs/xfs/xfs_trans.c | 14 +-
> 1 fil
On Fri, Aug 25, 2023 at 09:54:04PM +0800, Hao Xu wrote:
> From: Hao Xu
>
> XBF_TRYLOCK means we need lock but don't block on it,
Yes.
> we can use it to
> stand for not waiting for memory allcation. Rename XBF_TRYLOCK to
> XBF_NOWAIT, which is more generic.
No.
Not only can XBF_TRYLOCK requi
Hi Daniel,
f2fs_format_main.c: In function ‘add_default_options’:
f2fs_format_main.c:142:41: error: ‘struct f2fs_configuration’ has no member
named ‘blksize’
142 | c.wanted_sector_size = c.blksize;
| ^
make[2]: *** [Makefile:516: f2f
Hello:
The following patches were marked "accepted", because they were applied to
jaegeuk/f2fs.git (dev):
Series: [f2fs-dev,1/3] f2fs: clean up error handling in
sanity_check_{compress_, }inode()
Submitter: Chao Yu
Committer: Jaegeuk Kim
Patchwork: https://patchwork.kernel.org/project/f2
Hello:
This series was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim :
On Mon, 21 Aug 2023 23:22:23 +0800 you wrote:
> In sanity_check_{compress_,}inode(), it doesn't need to set SBI_NEED_FSCK
> in each error case, instead, we can set the flag in do_read_inode() only
> once when sanity_check_i
On Fri, Aug 25, 2023 at 09:54:02PM +0800, Hao Xu wrote:
> From: Hao Xu
>
> This series introduce getdents64 to io_uring, the code logic is similar
> with the snychronized version's. It first try nowait issue, and offload
> it to io-wq threads if the first try fails.
NAK on the entire series unti
On Fri, Aug 25, 2023 at 09:54:14PM +0800, Hao Xu wrote:
> +++ b/fs/xfs/xfs_iops.c
> @@ -1037,6 +1037,8 @@ xfs_vn_update_time(
> int log_flags = XFS_ILOG_TIMESTAMP;
> struct xfs_trans*tp;
> int error;
> + int o
On Fri, Aug 25, 2023 at 09:54:24PM +0800, Hao Xu wrote:
> @@ -633,6 +633,8 @@ xfs_buf_find_insert(
>* allocate the memory from the heap to minimise memory usage. If we
>* can't get heap memory for these small buffers, we fall back to using
>* the page allocator.
> + * x
From: Hao Xu
This add support for getdents64 to io_uring, acting exactly like the
syscall: the directory is iterated from it's current's position as
stored in the file struct, and the file's position is updated exactly as
if getdents64 had been called.
For filesystems that support NOWAIT in iter
From: Hao Xu
Apply trylock logic for xc_ctx_lock in xlog_cil_commit() in nowait
case and error out -EAGAIN for xlog_cil_commit().
Signed-off-by: Hao Xu
---
fs/xfs/xfs_log_cil.c | 12 ++--
fs/xfs/xfs_log_priv.h | 2 +-
fs/xfs/xfs_trans.c| 4 +++-
3 files changed, 14 insertions(+)
From: Hao Xu
vmalloc() always succeed in 64 bit system?
Not a real patch.
Signed-off-by: Hao Xu
---
fs/xfs/xfs_log_cil.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/xfs/xfs_log_cil.c b/fs/xfs/xfs_log_cil.c
index f17c1799b3c4..b31830ee36dd 100644
--- a/fs/xfs/xfs_log_cil.c
+++ b/f
From: Hao Xu
if the log transaction is a sync one, let's fail the nowait try and
return -EAGAIN directly since sync transaction means blocked by IO.
Signed-off-by: Hao Xu
---
fs/xfs/xfs_trans.c | 14 +-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/fs/xfs/xfs_trans.
From: Hao Xu
support nowait for xfs_buf_item_init() and error out -EAGAIN to
_xfs_trans_bjoin() when it would block.
Signed-off-by: Hao Xu
---
fs/xfs/xfs_buf_item.c | 9 +++--
fs/xfs/xfs_buf_item.h | 2 +-
fs/xfs/xfs_buf_item_recover.c | 2 +-
fs/xfs/xfs_trans_buf.c
From: Hao Xu
This causes xfstests generic/232 hung in umount process, waiting for ail
push, so I comment it for now, need some hints from xfs folks.
Not a real patch.
Signed-off-by: Hao Xu
---
fs/xfs/xfs_buf.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs
From: Hao Xu
Add comments for page allocation in nowait case in xfs_buf_find_insert()
Signed-off-by: Hao Xu
---
fs/xfs/xfs_buf.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index eb3cd7702545..57bdc4c5dde1 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs
From: Hao Xu
-EAGAIN is internal error to indicate a retry, no needs to print a
warn.
Signed-off-by: Hao Xu
---
fs/xfs/xfs_buf.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index 57bdc4c5dde1..cdad80e1ae25 100644
--- a/fs/xfs/x
From: Hao Xu
Rather than wait for a moment and retry, we return -EAGAIN when we fail
to allocate bulk memory in xfs_buf_alloc_pages() in nowait case.
Signed-off-by: Hao Xu
---
fs/xfs/xfs_buf.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index a6
From: Hao Xu
Previously, if we fail to get the memory we need, -ENOMEM is returned.
It can be -EAGAIN now since we support nowait now. Return the latter
when it is the case. Involved functions are: _xfs_buf_map_pages(),
xfs_buf_get_maps(), xfs_buf_alloc_kmem() and xfs_buf_alloc_pages().
Signed-
From: Hao Xu
Choose different gfp flags to support nowait memory allocation in
_xfs_buf_alloc().
Signed-off-by: Hao Xu
---
fs/xfs/xfs_buf.c | 7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index 9f84bc3b802c..8b800ce28996 100644
---
From: Hao Xu
Change return value of xfs_trans_ijoin() to error out -EAGAIN.
Signed-off-by: Hao Xu
---
fs/xfs/libxfs/xfs_trans_inode.c | 13 +
fs/xfs/xfs_iops.c | 4 +++-
fs/xfs/xfs_trans.h | 2 +-
3 files changed, 13 insertions(+), 6 deletions(-)
diff
From: Hao Xu
Add nowait parameter for xfs_inode_item_init() to support nowait
semantics.
Signed-off-by: Hao Xu
---
fs/xfs/libxfs/xfs_trans_inode.c | 3 ++-
fs/xfs/xfs_inode_item.c | 12
fs/xfs/xfs_inode_item.h | 3 ++-
3 files changed, 12 insertions(+), 6 deletio
From: Hao Xu
Set XBF_NOWAIT for xfs_buf_read_map() if necessary.
Signed-off-by: Hao Xu
---
fs/xfs/xfs_trans_buf.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/xfs/xfs_trans_buf.c b/fs/xfs/xfs_trans_buf.c
index 6549e50d852c..016371f58f26 100644
--- a/fs/xfs/xfs_trans_buf.c
+++ b/fs/
From: Hao Xu
Don't sleep and wait for more space for a log ticket in
xlog_grant_head_check() when it is in nowait case.
Signed-off-by: Hao Xu
---
fs/xfs/xfs_log.c | 15 +--
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 90fbb
From: Hao Xu
Support nowait logic for xfs_log_reserve(), including add a nowait
boolean parameter and error out -EAGAIN for ticket allocation.
Signed-off-by: Hao Xu
---
fs/xfs/xfs_log.c | 18 +-
fs/xfs/xfs_log.h | 5 +++--
fs/xfs/xfs_log_cil.c | 2 +-
fs/xfs/xfs_lo
From: Hao Xu
There are locks in xfs_trans_alloc(), spot them and apply trylock logic.
Make them return -EAGAIN when it would block. To achieve this, add
nowait parameter for those functions in the path. Besides, add a generic
transaction flag XFS_TRANS_NOWAIT to deliver nowait info.
Signed-off-b
From: Hao Xu
Enforce GFP_NOIO logic implicitly by set pflags if we are in nowait
time update process. Nowait semantics means no waiting for IO,
therefore GFP_NOIO is needed.
Signed-off-by: Hao Xu
---
fs/xfs/xfs_iops.c | 22 +-
1 file changed, 17 insertions(+), 5 deletions(-
From: Hao Xu
Trylock inode->i_rwsem in iterate_dir() to support nowait semantics and
error out -EAGAIN when there is contention.
Signed-off-by: Hao Xu
---
fs/readdir.c | 20 ++--
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/fs/readdir.c b/fs/readdir.c
index 64
From: Hao Xu
Add a new time flag S_NOWAIT to support nowait time update. Deliver it
to specific filesystem and error out -EAGAIN when it would block.
Signed-off-by: Hao Xu
---
fs/inode.c | 9 +
fs/xfs/xfs_iops.c | 8 +++-
include/linux/fs.h | 1 +
3 files changed, 13 inser
From: Hao Xu
Move file_accessed() to the beginning of iterate_dir() so that we don't
need to rollback all the work done when file_accessed() returns -EAGAIN
at the end of getdents.
Signed-off-by: Hao Xu
---
fs/readdir.c | 7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/
From: Hao Xu
Add a boolean parameter for file_accessed() to support nowait semantics.
Currently it is true only with io_uring as its initial caller.
Signed-off-by: Hao Xu
---
arch/s390/hypfs/inode.c | 2 +-
block/fops.c| 2 +-
fs/btrfs/file.c | 2 +-
fs/btrfs/inode.c
From: Hao Xu
Add a nowait boolean parameter for touch_atime() to support nowait
semantics. It is true only when io_uring is the initial caller.
Signed-off-by: Hao Xu
---
fs/cachefiles/namei.c | 2 +-
fs/ecryptfs/file.c| 4 ++--
fs/inode.c| 7 ---
fs/namei.c| 4 +
From: Hao Xu
Add a helper to unlock f_pos_lock without any condition. Introduce this
since io_uring handles f_pos_lock not with a fd struct, thus
FDPUT_POS_UNLOCK isn't used.
Signed-off-by: Hao Xu
---
include/linux/file.h | 5 +
1 file changed, 5 insertions(+)
diff --git a/include/linux/f
From: Hao Xu
Add a vfs helper file_pos_lock_nowait() for io_uring usage. The function
have conditional nowait logic, i.e. if nowait is needed, return -EAGAIN
when trylock fails.
Signed-off-by: Hao Xu
---
fs/file.c| 13 +
include/linux/file.h | 2 ++
2 files changed, 15
From: Hao Xu
The flags will allow passing DIR_CONTEXT_F_NOWAIT to iterate()
implementations that support it (as signaled through FMODE_NWAIT
in file->f_mode)
Notes:
- considered using IOCB_NOWAIT but if we add more flags later it
would be confusing to keep track of which values are valid, use
de
From: Hao Xu
Implement NOWAIT semantics for readdir. Return EAGAIN error to the
caller if it would block, like failing to get locks, or going to
do IO.
Co-developed-by: Dave Chinner
Signed-off-by: Dave Chinner
Signed-off-by: Hao Xu
[fixes deadlock issue, tweak code style]
---
fs/xfs/libxfs/x
From: Hao Xu
XBF_TRYLOCK means we need lock but don't block on it, we can use it to
stand for not waiting for memory allcation. Rename XBF_TRYLOCK to
XBF_NOWAIT, which is more generic.
Signed-off-by: Hao Xu
---
fs/xfs/libxfs/xfs_alloc.c | 2 +-
fs/xfs/libxfs/xfs_attr_remote.c | 2 +-
fs/
From: Dominique Martinet
This splits off the vfs_getdents function from the getdents64 system
call.
This will allow io_uring to call the vfs_getdents function.
Co-developed-by: Stefan Roesch
Signed-off-by: Stefan Roesch
Signed-off-by: Dominique Martinet
Signed-off-by: Hao Xu
---
fs/internal
From: Hao Xu
This series introduce getdents64 to io_uring, the code logic is similar
with the snychronized version's. It first try nowait issue, and offload
it to io-wq threads if the first try fails.
Patch1 and Patch2 are some preparation
Patch3 supports nowait for xfs getdents code
Patch4-11 a
On Fri 25-08-23 02:58:43, Al Viro wrote:
> On Fri, Aug 11, 2023 at 01:04:31PM +0200, Jan Kara wrote:
> > Hello,
> >
> > this is a v2 of the patch series which implements the idea of
> > blkdev_get_by_*()
> > calls returning bdev_handle which is then passed to blkdev_put() [1]. This
> > makes the
On Wed, Aug 23, 2023 at 12:48:11PM +0200, Jan Kara wrote:
> Hello,
>
> this is a v3 of the patch series which implements the idea of
> blkdev_get_by_*()
> calls returning bdev_handle which is then passed to blkdev_put() [1]. This
> makes the get and put calls for bdevs more obviously matching and
On Wed, Aug 23, 2023 at 12:48:34PM +0200, Jan Kara wrote:
> Convert f2fs to use bdev_open_by_dev/path() and pass the handle around.
>
> CC: Jaegeuk Kim
> CC: Chao Yu
> CC: linux-f2fs-devel@lists.sourceforge.net
> Acked-by: Christoph Hellwig
> Signed-off-by: Jan Kara
> ---
Looks good to me,
Re
On 2023/8/25 13:37, Lizhi Xu wrote:
There are two paths:
1. f2fs_add_dentry->f2fs_down_read->f2fs_add_inline_entry->down_write->
up_write->f2fs_up_read
2. f2fs_add_dentry->f2fs_add_regular_entry->down_write->
f2fs_init_inode_metadata->f2fs_down_read->f2fs_up_read->up_write
Force order lo
57 matches
Mail list logo