Skip to content

Commit 548e7f5

Browse files
author
Kent Overstreet
committed
bcachefs: setting bcachefs_effective.* xattrs is a noop
bcachefs_effective.* xattrs show the options inherited from parent directories (as well as explicitly set); this namespace is not for setting bcachefs options. Change the .set() handler to a noop so that if e.g. rsync is copying xattrs it'll do the right thing, and only copy xattrs in the bcachefs.* namespace. We don't want to return an error, because that will cause rsync to bail out or get spammy. Signed-off-by: Kent Overstreet <[email protected]>
1 parent 8cc0e50 commit 548e7f5

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

fs/bcachefs/xattr.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,10 +612,20 @@ static int bch2_xattr_bcachefs_get_effective(
612612
name, buffer, size, true);
613613
}
614614

615+
/* Noop - xattrs in the bcachefs_effective namespace are inherited */
616+
static int bch2_xattr_bcachefs_set_effective(const struct xattr_handler *handler,
617+
struct mnt_idmap *idmap,
618+
struct dentry *dentry, struct inode *vinode,
619+
const char *name, const void *value,
620+
size_t size, int flags)
621+
{
622+
return 0;
623+
}
624+
615625
static const struct xattr_handler bch_xattr_bcachefs_effective_handler = {
616626
.prefix = "bcachefs_effective.",
617627
.get = bch2_xattr_bcachefs_get_effective,
618-
.set = bch2_xattr_bcachefs_set,
628+
.set = bch2_xattr_bcachefs_set_effective,
619629
};
620630

621631
#endif /* NO_BCACHEFS_FS */

0 commit comments

Comments
 (0)