From 8fae948d60dbdc53278013c8103651578aee8c12 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Tue, 15 Apr 2025 15:32:34 -0400 Subject: fixup! posix_to_bcachefs: Process dirents in sorted order --- c_src/posix_to_bcachefs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/c_src/posix_to_bcachefs.c b/c_src/posix_to_bcachefs.c index 880ef531..3c2e72d8 100644 --- a/c_src/posix_to_bcachefs.c +++ b/c_src/posix_to_bcachefs.c @@ -319,7 +319,8 @@ static int dirent_cmp(const void *_l, const void *_r) const struct dirent *l = _l; const struct dirent *r = _r; - return strcmp(l->d_name, r->d_name); + return cmp_int(l->d_type, r->d_type) ?: + strcmp(l->d_name, r->d_name); } static void copy_dir(struct copy_fs_state *s, -- cgit v1.2.3