summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/fs-ioctl.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2020-08-24 20:57:48 +0200
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 23:08:44 +0200
commit7af0cec3076886d16114f4ca9794dfba3674794e (patch)
tree4b852054b0663e91328861142f151eecfb221cf2 /fs/bcachefs/fs-ioctl.c
parentbcachefs: Don't report inodes to statfs (diff)
downloadlinux-7af0cec3076886d16114f4ca9794dfba3674794e.tar.xz
linux-7af0cec3076886d16114f4ca9794dfba3674794e.zip
bcachefs: Some project id fixes
Inode options that are accessible via the xattr interface are stored with a +1 bias, so that a value of 0 means unset. We weren't handling this consistently. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/fs-ioctl.c')
-rw-r--r--fs/bcachefs/fs-ioctl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/bcachefs/fs-ioctl.c b/fs/bcachefs/fs-ioctl.c
index acc0a230ff0c..f6773783b958 100644
--- a/fs/bcachefs/fs-ioctl.c
+++ b/fs/bcachefs/fs-ioctl.c
@@ -138,6 +138,10 @@ static int bch2_ioc_fssetxattr(struct bch_fs *c,
if (fa.fsx_projid >= U32_MAX)
return -EINVAL;
+ /*
+ * inode fields accessible via the xattr interface are stored with a +1
+ * bias, so that 0 means unset:
+ */
s.projid = fa.fsx_projid + 1;
ret = mnt_want_write_file(file);
@@ -151,7 +155,7 @@ static int bch2_ioc_fssetxattr(struct bch_fs *c,
}
mutex_lock(&inode->ei_update_lock);
- ret = bch2_set_projid(c, inode, s.projid);
+ ret = bch2_set_projid(c, inode, fa.fsx_projid);
if (ret)
goto err_unlock;