Skip to content

Commit cd11242

Browse files
author
Kent Overstreet
committed
bcachefs: Ensure that snapshot creation propagates has_case_insensitive
We normally can't create a new directory with the case-insensitive option already set - except when we're creating a snapshot. And if casefolding is enabled filesystem wide, we should still set it even though not strictly required, for consistency. Signed-off-by: Kent Overstreet <[email protected]>
1 parent b68baf9 commit cd11242

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

fs/bcachefs/namei.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,16 @@ int bch2_create_trans(struct btree_trans *trans,
175175
new_inode->bi_dir_offset = dir_offset;
176176
}
177177

178+
if (S_ISDIR(mode)) {
179+
ret = bch2_maybe_propagate_has_case_insensitive(trans,
180+
(subvol_inum) {
181+
new_inode->bi_subvol ?: dir.subvol,
182+
new_inode->bi_inum },
183+
new_inode);
184+
if (ret)
185+
goto err;
186+
}
187+
178188
if (S_ISDIR(mode) &&
179189
!new_inode->bi_subvol)
180190
new_inode->bi_depth = dir_u->bi_depth + 1;

0 commit comments

Comments
 (0)