mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
NFS: make sure open context mode have FMODE_EXEC when file open for exec
Because file f_mode never have FMODE_EXEC, open context mode won't get FMODE_EXEC from file f_mode. Open context mode only care about FMODE_READ/ FMODE_WRITE/FMODE_EXEC, and all info about open context mode can be convert from file f_flags, so convert file f_flags to open context mode by flags_to_mode(). Signed-off-by: ChenXiaoSong <chenxiaosong2@huawei.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
This commit is contained in:
committed by
Trond Myklebust
parent
d01c6ed6db
commit
6f1c1d95dc
@@ -1168,7 +1168,8 @@ int nfs_open(struct inode *inode, struct file *filp)
|
||||
{
|
||||
struct nfs_open_context *ctx;
|
||||
|
||||
ctx = alloc_nfs_open_context(file_dentry(filp), filp->f_mode, filp);
|
||||
ctx = alloc_nfs_open_context(file_dentry(filp),
|
||||
flags_to_mode(filp->f_flags), filp);
|
||||
if (IS_ERR(ctx))
|
||||
return PTR_ERR(ctx);
|
||||
nfs_file_set_open_context(filp, ctx);
|
||||
|
||||
Reference in New Issue
Block a user