projects
/
linux-2.6-microblaze.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
io-wq: fix double put of 'wq' in error path
[linux-2.6-microblaze.git]
/
fs
/
remap_range.c
diff --git
a/fs/remap_range.c
b/fs/remap_range.c
index
77dba3a
..
e4a5fdd
100644
(file)
--- a/
fs/remap_range.c
+++ b/
fs/remap_range.c
@@
-432,13
+432,16
@@
EXPORT_SYMBOL(vfs_clone_file_range);
/* Check whether we are allowed to dedupe the destination file */
static bool allow_file_dedupe(struct file *file)
{
/* Check whether we are allowed to dedupe the destination file */
static bool allow_file_dedupe(struct file *file)
{
+ struct user_namespace *mnt_userns = file_mnt_user_ns(file);
+ struct inode *inode = file_inode(file);
+
if (capable(CAP_SYS_ADMIN))
return true;
if (file->f_mode & FMODE_WRITE)
return true;
if (capable(CAP_SYS_ADMIN))
return true;
if (file->f_mode & FMODE_WRITE)
return true;
- if (uid_eq(current_fsuid(),
file_inode(file)->i_uid
))
+ if (uid_eq(current_fsuid(),
i_uid_into_mnt(mnt_userns, inode)
))
return true;
return true;
- if (!inode_permission(
file_inode(file)
, MAY_WRITE))
+ if (!inode_permission(
mnt_userns, inode
, MAY_WRITE))
return true;
return false;
}
return true;
return false;
}