Commit 2f2f43d3 authored by Eric W. Biederman's avatar Eric W. Biederman

userns: Convert btrfs to use kuid/kgid where appropriate

Cc: Chris Mason <chris.mason@fusionio.com>
Acked-by: default avatarSerge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
parent 7f5b82b8
...@@ -1715,8 +1715,8 @@ static void fill_stack_inode_item(struct btrfs_trans_handle *trans, ...@@ -1715,8 +1715,8 @@ static void fill_stack_inode_item(struct btrfs_trans_handle *trans,
struct btrfs_inode_item *inode_item, struct btrfs_inode_item *inode_item,
struct inode *inode) struct inode *inode)
{ {
btrfs_set_stack_inode_uid(inode_item, inode->i_uid); btrfs_set_stack_inode_uid(inode_item, i_uid_read(inode));
btrfs_set_stack_inode_gid(inode_item, inode->i_gid); btrfs_set_stack_inode_gid(inode_item, i_gid_read(inode));
btrfs_set_stack_inode_size(inode_item, BTRFS_I(inode)->disk_i_size); btrfs_set_stack_inode_size(inode_item, BTRFS_I(inode)->disk_i_size);
btrfs_set_stack_inode_mode(inode_item, inode->i_mode); btrfs_set_stack_inode_mode(inode_item, inode->i_mode);
btrfs_set_stack_inode_nlink(inode_item, inode->i_nlink); btrfs_set_stack_inode_nlink(inode_item, inode->i_nlink);
...@@ -1764,8 +1764,8 @@ int btrfs_fill_inode(struct inode *inode, u32 *rdev) ...@@ -1764,8 +1764,8 @@ int btrfs_fill_inode(struct inode *inode, u32 *rdev)
inode_item = &delayed_node->inode_item; inode_item = &delayed_node->inode_item;
inode->i_uid = btrfs_stack_inode_uid(inode_item); i_uid_write(inode, btrfs_stack_inode_uid(inode_item));
inode->i_gid = btrfs_stack_inode_gid(inode_item); i_gid_write(inode, btrfs_stack_inode_gid(inode_item));
btrfs_i_size_write(inode, btrfs_stack_inode_size(inode_item)); btrfs_i_size_write(inode, btrfs_stack_inode_size(inode_item));
inode->i_mode = btrfs_stack_inode_mode(inode_item); inode->i_mode = btrfs_stack_inode_mode(inode_item);
set_nlink(inode, btrfs_stack_inode_nlink(inode_item)); set_nlink(inode, btrfs_stack_inode_nlink(inode_item));
......
...@@ -2570,8 +2570,8 @@ static void btrfs_read_locked_inode(struct inode *inode) ...@@ -2570,8 +2570,8 @@ static void btrfs_read_locked_inode(struct inode *inode)
struct btrfs_inode_item); struct btrfs_inode_item);
inode->i_mode = btrfs_inode_mode(leaf, inode_item); inode->i_mode = btrfs_inode_mode(leaf, inode_item);
set_nlink(inode, btrfs_inode_nlink(leaf, inode_item)); set_nlink(inode, btrfs_inode_nlink(leaf, inode_item));
inode->i_uid = btrfs_inode_uid(leaf, inode_item); i_uid_write(inode, btrfs_inode_uid(leaf, inode_item));
inode->i_gid = btrfs_inode_gid(leaf, inode_item); i_gid_write(inode, btrfs_inode_gid(leaf, inode_item));
btrfs_i_size_write(inode, btrfs_inode_size(leaf, inode_item)); btrfs_i_size_write(inode, btrfs_inode_size(leaf, inode_item));
tspec = btrfs_inode_atime(inode_item); tspec = btrfs_inode_atime(inode_item);
...@@ -2649,8 +2649,8 @@ static void fill_inode_item(struct btrfs_trans_handle *trans, ...@@ -2649,8 +2649,8 @@ static void fill_inode_item(struct btrfs_trans_handle *trans,
struct btrfs_inode_item *item, struct btrfs_inode_item *item,
struct inode *inode) struct inode *inode)
{ {
btrfs_set_inode_uid(leaf, item, inode->i_uid); btrfs_set_inode_uid(leaf, item, i_uid_read(inode));
btrfs_set_inode_gid(leaf, item, inode->i_gid); btrfs_set_inode_gid(leaf, item, i_gid_read(inode));
btrfs_set_inode_size(leaf, item, BTRFS_I(inode)->disk_i_size); btrfs_set_inode_size(leaf, item, BTRFS_I(inode)->disk_i_size);
btrfs_set_inode_mode(leaf, item, inode->i_mode); btrfs_set_inode_mode(leaf, item, inode->i_mode);
btrfs_set_inode_nlink(leaf, item, inode->i_nlink); btrfs_set_inode_nlink(leaf, item, inode->i_nlink);
......
...@@ -575,13 +575,13 @@ static int create_snapshot(struct btrfs_root *root, struct dentry *dentry, ...@@ -575,13 +575,13 @@ static int create_snapshot(struct btrfs_root *root, struct dentry *dentry,
*/ */
static inline int btrfs_check_sticky(struct inode *dir, struct inode *inode) static inline int btrfs_check_sticky(struct inode *dir, struct inode *inode)
{ {
uid_t fsuid = current_fsuid(); kuid_t fsuid = current_fsuid();
if (!(dir->i_mode & S_ISVTX)) if (!(dir->i_mode & S_ISVTX))
return 0; return 0;
if (inode->i_uid == fsuid) if (uid_eq(inode->i_uid, fsuid))
return 0; return 0;
if (dir->i_uid == fsuid) if (uid_eq(dir->i_uid, fsuid))
return 0; return 0;
return !capable(CAP_FOWNER); return !capable(CAP_FOWNER);
} }
......
...@@ -930,7 +930,6 @@ config UIDGID_CONVERTED ...@@ -930,7 +930,6 @@ config UIDGID_CONVERTED
depends on 9P_FS = n depends on 9P_FS = n
depends on AFS_FS = n depends on AFS_FS = n
depends on AUTOFS4_FS = n depends on AUTOFS4_FS = n
depends on BTRFS_FS = n
depends on CEPH_FS = n depends on CEPH_FS = n
depends on CIFS = n depends on CIFS = n
depends on CODA_FS = n depends on CODA_FS = n
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment