summaryrefslogtreecommitdiff
path: root/fs/bcachefs/fs-ioctl.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-12-13 08:32:11 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:13 -0400
commit721d4ad8eb55bf66ef55b31438b6c8361acf283f (patch)
treef84119c7664549dc49ac624a4eddf5bb58be6eaf /fs/bcachefs/fs-ioctl.c
parent0f5254aa98befa5187cc4d02584ab0f19d18ff68 (diff)
bcachefs: Add flags to indicate if inode opts were inherited or explicitly set
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/fs-ioctl.c')
-rw-r--r--fs/bcachefs/fs-ioctl.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/bcachefs/fs-ioctl.c b/fs/bcachefs/fs-ioctl.c
index 701882ce6024..d6563370bec4 100644
--- a/fs/bcachefs/fs-ioctl.c
+++ b/fs/bcachefs/fs-ioctl.c
@@ -122,7 +122,14 @@ static int fssetxattr_inode_update_fn(struct bch_inode_info *inode,
{
struct flags_set *s = p;
- bi->bi_project = s->projid;
+ if (s->projid != bi->bi_project) {
+ if (s->projid)
+ bi->bi_fields_set |= 1U << Inode_opt_project;
+ else
+ bi->bi_fields_set &= ~(1U << Inode_opt_project);
+
+ bi->bi_project = s->projid;
+ }
return bch2_inode_flags_set(inode, bi, p);
}