Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
16ba67b1
Commit
16ba67b1
authored
Mar 10, 2005
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFSv4: Fix access mode checking when opening a delegated file.
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
c80650bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
fs/nfs/nfs4proc.c
fs/nfs/nfs4proc.c
+7
-3
No files found.
fs/nfs/nfs4proc.c
View file @
16ba67b1
...
@@ -357,11 +357,16 @@ static int _nfs4_proc_open_confirm(struct rpc_clnt *clnt, const struct nfs_fh *f
...
@@ -357,11 +357,16 @@ static int _nfs4_proc_open_confirm(struct rpc_clnt *clnt, const struct nfs_fh *f
return
status
;
return
status
;
}
}
static
int
_nfs4_do_access
(
struct
inode
*
inode
,
struct
rpc_cred
*
cred
,
int
mask
)
static
int
_nfs4_do_access
(
struct
inode
*
inode
,
struct
rpc_cred
*
cred
,
int
openflags
)
{
{
struct
nfs_access_entry
cache
;
struct
nfs_access_entry
cache
;
int
mask
=
0
;
int
status
;
int
status
;
if
(
openflags
&
FMODE_READ
)
mask
|=
MAY_READ
;
if
(
openflags
&
FMODE_WRITE
)
mask
|=
MAY_WRITE
;
status
=
nfs_access_get_cached
(
inode
,
cred
,
&
cache
);
status
=
nfs_access_get_cached
(
inode
,
cred
,
&
cache
);
if
(
status
==
0
)
if
(
status
==
0
)
goto
out
;
goto
out
;
...
@@ -392,7 +397,6 @@ static int _nfs4_open_delegated(struct inode *inode, int flags, struct rpc_cred
...
@@ -392,7 +397,6 @@ static int _nfs4_open_delegated(struct inode *inode, int flags, struct rpc_cred
struct
nfs4_state_owner
*
sp
=
NULL
;
struct
nfs4_state_owner
*
sp
=
NULL
;
struct
nfs4_state
*
state
=
NULL
;
struct
nfs4_state
*
state
=
NULL
;
int
open_flags
=
flags
&
(
FMODE_READ
|
FMODE_WRITE
);
int
open_flags
=
flags
&
(
FMODE_READ
|
FMODE_WRITE
);
int
mask
=
0
;
int
err
;
int
err
;
/* Protect against reboot recovery - NOTE ORDER! */
/* Protect against reboot recovery - NOTE ORDER! */
...
@@ -426,7 +430,7 @@ static int _nfs4_open_delegated(struct inode *inode, int flags, struct rpc_cred
...
@@ -426,7 +430,7 @@ static int _nfs4_open_delegated(struct inode *inode, int flags, struct rpc_cred
goto
out_err
;
goto
out_err
;
lock_kernel
();
lock_kernel
();
err
=
_nfs4_do_access
(
inode
,
cred
,
mask
);
err
=
_nfs4_do_access
(
inode
,
cred
,
open_flags
);
unlock_kernel
();
unlock_kernel
();
if
(
err
!=
0
)
if
(
err
!=
0
)
goto
out_err
;
goto
out_err
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment