Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
1b370bc2
Commit
1b370bc2
authored
Jul 07, 2007
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFSv4: Allow nfs4_opendata_to_nfs4_state to return errors.
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
6f43ddcc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
11 deletions
+18
-11
fs/nfs/nfs4proc.c
fs/nfs/nfs4proc.c
+18
-11
No files found.
fs/nfs/nfs4proc.c
View file @
1b370bc2
...
...
@@ -385,15 +385,19 @@ static struct nfs4_state *nfs4_opendata_to_nfs4_state(struct nfs4_opendata *data
struct
nfs4_state
*
state
=
NULL
;
struct
nfs_delegation
*
delegation
;
nfs4_stateid
*
deleg_stateid
=
NULL
;
int
ret
;
ret
=
-
EAGAIN
;
if
(
!
(
data
->
f_attr
.
valid
&
NFS_ATTR_FATTR
))
goto
out
;
goto
err
;
inode
=
nfs_fhget
(
data
->
dir
->
d_sb
,
&
data
->
o_res
.
fh
,
&
data
->
f_attr
);
ret
=
PTR_ERR
(
inode
);
if
(
IS_ERR
(
inode
))
goto
out
;
goto
err
;
ret
=
-
ENOMEM
;
state
=
nfs4_get_open_state
(
inode
,
data
->
owner
);
if
(
state
==
NULL
)
goto
put_inode
;
goto
err_
put_inode
;
if
(
data
->
o_res
.
delegation_type
!=
0
)
{
int
delegation_flags
=
0
;
...
...
@@ -417,10 +421,12 @@ static struct nfs4_state *nfs4_opendata_to_nfs4_state(struct nfs4_opendata *data
deleg_stateid
=
&
delegation
->
stateid
;
update_open_stateid
(
state
,
&
data
->
o_res
.
stateid
,
deleg_stateid
,
data
->
o_arg
.
open_flags
);
rcu_read_unlock
();
put_inode:
iput
(
inode
);
out:
return
state
;
err_put_inode:
iput
(
inode
);
err:
return
ERR_PTR
(
ret
);
}
static
struct
nfs_open_context
*
nfs4_state_find_open_context
(
struct
nfs4_state
*
state
)
...
...
@@ -453,7 +459,8 @@ static int nfs4_open_recover_helper(struct nfs4_opendata *opendata, mode_t openf
if
(
ret
!=
0
)
return
ret
;
newstate
=
nfs4_opendata_to_nfs4_state
(
opendata
);
if
(
newstate
!=
NULL
)
if
(
IS_ERR
(
newstate
))
return
PTR_ERR
(
newstate
);
nfs4_close_state
(
&
opendata
->
path
,
newstate
,
openflags
);
*
res
=
newstate
;
return
0
;
...
...
@@ -631,7 +638,7 @@ static void nfs4_open_confirm_release(void *calldata)
goto
out_free
;
nfs_confirm_seqid
(
&
data
->
owner
->
so_seqid
,
0
);
state
=
nfs4_opendata_to_nfs4_state
(
data
);
if
(
state
!=
NULL
)
if
(
!
IS_ERR
(
state
)
)
nfs4_close_state
(
&
data
->
path
,
state
,
data
->
o_arg
.
open_flags
);
out_free:
nfs4_opendata_put
(
data
);
...
...
@@ -736,7 +743,7 @@ static void nfs4_open_release(void *calldata)
goto
out_free
;
nfs_confirm_seqid
(
&
data
->
owner
->
so_seqid
,
0
);
state
=
nfs4_opendata_to_nfs4_state
(
data
);
if
(
state
!=
NULL
)
if
(
!
IS_ERR
(
state
)
)
nfs4_close_state
(
&
data
->
path
,
state
,
data
->
o_arg
.
open_flags
);
out_free:
nfs4_opendata_put
(
data
);
...
...
@@ -1036,9 +1043,9 @@ static int _nfs4_do_open(struct inode *dir, struct path *path, int flags, struct
if
(
opendata
->
o_arg
.
open_flags
&
O_EXCL
)
nfs4_exclusive_attrset
(
opendata
,
sattr
);
status
=
-
ENOMEM
;
state
=
nfs4_opendata_to_nfs4_state
(
opendata
);
if
(
state
==
NULL
)
status
=
PTR_ERR
(
state
);
if
(
IS_ERR
(
state
))
goto
err_opendata_put
;
nfs4_opendata_put
(
opendata
);
nfs4_put_state_owner
(
sp
);
...
...
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