Re: [PATCH 06/30] bcachefs: Remove calls to folio_set_error

2024-04-19 Thread Kent Overstreet
On Sat, Apr 20, 2024 at 03:50:01AM +0100, Matthew Wilcox (Oracle) wrote: > Common code doesn't test the error flag, so we don't need to set it in > bcachefs. We can use folio_end_read() to combine the setting (or not) > of the uptodate flag and clearing the lock flag. > > Cc: Kent Overstreet > C

[PATCH 06/30] bcachefs: Remove calls to folio_set_error

2024-04-19 Thread Matthew Wilcox (Oracle)
Common code doesn't test the error flag, so we don't need to set it in bcachefs. We can use folio_end_read() to combine the setting (or not) of the uptodate flag and clearing the lock flag. Cc: Kent Overstreet Cc: Brian Foster Cc: linux-bcachefs@vger.kernel.org Signed-off-by: Matthew Wilcox (Or

Re: [PATCH v3 4/4] bcachefs: add fiemap delalloc extent detection

2024-04-19 Thread Kent Overstreet
On Thu, Apr 18, 2024 at 10:46:21AM -0400, Brian Foster wrote: > So Kent had pointed out in an earlier chat that this needs to be a > little more robust wrt to transaction restart because there is the > potential for spinning under folio lock contention. I think there are a > couple ways to do this

[PATCH v4 3/4] bcachefs: refactor fiemap processing into extent helper and struct

2024-04-19 Thread Brian Foster
The bulk of the loop in bch2_fiemap() involves processing the current extent key from the iter, including following indirections and trimming the extent size and such. This patch makes a few changes to reduce the size of the loop and facilitate future changes to support delalloc extents. Define a

[PATCH v4 4/4] bcachefs: add fiemap delalloc extent detection

2024-04-19 Thread Brian Foster
bcachefs currently populates fiemap data from the extents btree. This works correctly when the fiemap sync flag is provided, but if not, it skips all delalloc extents that have not yet been flushed. This is because delalloc extents from buffered writes are first stored as reservation in the pagecac

[PATCH v4 2/4] bcachefs: track current fiemap offset in start variable

2024-04-19 Thread Brian Foster
Signed-off-by: Brian Foster --- fs/bcachefs/fs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c index f6cd14c9b38c..8b806e33c6c9 100644 --- a/fs/bcachefs/fs.c +++ b/fs/bcachefs/fs.c @@ -1011,6 +1011,7 @@ static int bch2_fiemap(struct in

[PATCH v4 1/4] bcachefs: drop duplicate fiemap sync flag

2024-04-19 Thread Brian Foster
FIEMAP_FLAG_SYNC handling was deliberately moved into core code in commit 45dd052e67ad ("fs: handle FIEMAP_FLAG_SYNC in fiemap_prep"), released in kernel v5.8. Update bcachefs accordingly. Signed-off-by: Brian Foster --- fs/bcachefs/fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) dif

[PATCH v4 0/4] bcachefs: fiemap delalloc support and cleanup

2024-04-19 Thread Brian Foster
Hi all, This is mostly equivalent to v3 except that bch2_fiemap_hole() now implements a do_drop_locks() style pattern to manage locking order between folios and the extent tree. The pagecache scan is factored out into a new helper to facilitate the retry. Patches also available in my test branch:

Re: syzbot for bcachefs?

2024-04-19 Thread Kent Overstreet
On Fri, Apr 19, 2024 at 10:35:27AM +0200, Dmitry Vyukov wrote: > On Fri, 5 Apr 2024 at 18:20, Aleksandr Nogikh wrote: > > > > On Fri, Apr 5, 2024 at 1:16 AM Kent Overstreet > > wrote: > > > > > > On Thu, Apr 04, 2024 at 10:33:07AM +0200, Dmitry Vyukov wrote: > > > > On Thu, 4 Apr 2024 at 01:59, K

Re: [LTP] [PATCH v2 3/3] statx04: Skip STATX_ATTR_COMPRESSED on Bcachefs

2024-04-19 Thread Cyril Hrubis
Hi! > > > Quite likely, other filesystems does have an inode flag that is set when > > > file has been compressed and simply report that in the foo_getattr() > > > callback. Looking at bcachefs I supose that we need to figure out if the > > > inode is v3 and then unpack the v3 info to get to the co

Re: syzbot for bcachefs?

2024-04-19 Thread Dmitry Vyukov
On Fri, 5 Apr 2024 at 18:20, Aleksandr Nogikh wrote: > > On Fri, Apr 5, 2024 at 1:16 AM Kent Overstreet > wrote: > > > > On Thu, Apr 04, 2024 at 10:33:07AM +0200, Dmitry Vyukov wrote: > > > On Thu, 4 Apr 2024 at 01:59, Kent Overstreet > > > wrote: > > > > > > > > Hi - what would it take to get

[PATCH 1/2] bcachefs: eliminate the uninitialized compilation warning in bch2_reconstruct_snapshots

2024-04-19 Thread Hongbo Li
[BUG] When compiling the bcachefs-tools, the following compilation warning is reported: libbcachefs/snapshot.c: In function ‘bch2_reconstruct_snapshots’: libbcachefs/snapshot.c:915:19: warning: ‘tree_id’ may be used uninitialized in this function [-Wmaybe-uninitialized] 915 | snapsh

[PATCH 0/2] eliminate the uninitialized compilation warning

2024-04-19 Thread Hongbo Li
Eliminating the uninitialized compilation warning in bcachefs-tools. Hongbo Li (2): bcachefs: eliminate the uninitialized compilation warning in bch2_reconstruct_snapshots bcachefs: eliminate the uninitialized compilation warning in __do_six_trylock fs/bcachefs/six.c | 6 ++

[PATCH 2/2] bcachefs: eliminate the uninitialized compilation warning in __do_six_trylock

2024-04-19 Thread Hongbo Li
When compiling the bcachefs-tools, the following compilation warning is reported: libbcachefs/six.c: In function ‘__do_six_trylock’: libbcachefs/six.c:90:12: warning: ‘old’ may be used uninitialized in this function [-Wmaybe-uninitialized] 90 | if (!(old & SIX_LOCK_HELD_intent)) {

subscribe bcachefs

2024-04-19 Thread wangjianjian (C)
subscribe bcachefs -- Regards