From: Christian Brauner <christian.brauner@xxxxxxxxxx> Enable btrfs_permission() to handle idmapped mounts. This is just a matter of passing down the mount's userns. Cc: Chris Mason <clm@xxxxxx> Cc: Josef Bacik <josef@xxxxxxxxxxxxxx> Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx> Cc: David Sterba <dsterba@xxxxxxxx> Cc: linux-btrfs@xxxxxxxxxxxxxxx Signed-off-by: Christian Brauner <christian.brauner@xxxxxxxxxx> --- fs/btrfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 8a80ef810703..3b537d90172e 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -10185,7 +10185,7 @@ static int btrfs_permission(struct user_namespace *mnt_userns, if (BTRFS_I(inode)->flags & BTRFS_INODE_READONLY) return -EACCES; } - return generic_permission(&init_user_ns, inode, mask); + return generic_permission(mnt_userns, inode, mask); } static int btrfs_tmpfile(struct user_namespace *mnt_userns, struct inode *dir, -- 2.30.2