* [PATCH] bcachefs: bch2_dir_emit() - fix directory reads in the fuse driver
@ 2024-05-30 18:03 Ariel Miculas
0 siblings, 0 replies; only message in thread
From: Ariel Miculas @ 2024-05-30 18:03 UTC (permalink / raw)
To: linux-bcachefs; +Cc: Ariel Miculas, Kent Overstreet, Brian Foster, linux-kernel
Commit 0c0cbfdb84725e9933a24ecf47c61bdeeda06ba2 dropped the ctx->pos
update before the call to dir_emit. This breaks the userspace
implementation, causing the directory reads to be stuck in an infinite
loop. This doesn't happen in the kernel because the vfs handles the
updates to ctx->pos, but in the fuse implementation nobody updates
it.
Signed-off-by: Ariel Miculas <ariel.miculas@gmail.com>
---
fs/bcachefs/dirent.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/bcachefs/dirent.c b/fs/bcachefs/dirent.c
index c67460d8205d..f1d5ee19e5ea 100644
--- a/fs/bcachefs/dirent.c
+++ b/fs/bcachefs/dirent.c
@@ -534,6 +534,7 @@ int bch2_empty_dir_trans(struct btree_trans *trans, subvol_inum dir)
static int bch2_dir_emit(struct dir_context *ctx, struct bkey_s_c_dirent d, subvol_inum target)
{
struct qstr name = bch2_dirent_get_name(d);
+ ctx->pos = d.k->p.offset;
bool ret = dir_emit(ctx, name.name,
name.len,
target.inum,
--
2.34.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-05-30 18:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-30 18:03 [PATCH] bcachefs: bch2_dir_emit() - fix directory reads in the fuse driver Ariel Miculas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®