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
1c3eff7e
Commit
1c3eff7e
authored
Nov 19, 2020
by
Chuck Lever
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFSD: Replace READ* macros that decode the fattr4 time_set attributes
Signed-off-by:
Chuck Lever
<
chuck.lever@oracle.com
>
parent
393c31dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
10 deletions
+29
-10
fs/nfsd/nfs4xdr.c
fs/nfsd/nfs4xdr.c
+29
-10
No files found.
fs/nfsd/nfs4xdr.c
View file @
1c3eff7e
...
@@ -219,6 +219,21 @@ nfsd4_decode_time(struct nfsd4_compoundargs *argp, struct timespec64 *tv)
...
@@ -219,6 +219,21 @@ nfsd4_decode_time(struct nfsd4_compoundargs *argp, struct timespec64 *tv)
DECODE_TAIL
;
DECODE_TAIL
;
}
}
static
__be32
nfsd4_decode_nfstime4
(
struct
nfsd4_compoundargs
*
argp
,
struct
timespec64
*
tv
)
{
__be32
*
p
;
p
=
xdr_inline_decode
(
argp
->
xdr
,
XDR_UNIT
*
3
);
if
(
!
p
)
return
nfserr_bad_xdr
;
p
=
xdr_decode_hyper
(
p
,
&
tv
->
tv_sec
);
tv
->
tv_nsec
=
be32_to_cpup
(
p
++
);
if
(
tv
->
tv_nsec
>=
(
u32
)
1000000000
)
return
nfserr_inval
;
return
nfs_ok
;
}
static
__be32
static
__be32
nfsd4_decode_bitmap
(
struct
nfsd4_compoundargs
*
argp
,
u32
*
bmval
)
nfsd4_decode_bitmap
(
struct
nfsd4_compoundargs
*
argp
,
u32
*
bmval
)
{
{
...
@@ -388,11 +403,13 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,
...
@@ -388,11 +403,13 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,
iattr
->
ia_valid
|=
ATTR_GID
;
iattr
->
ia_valid
|=
ATTR_GID
;
}
}
if
(
bmval
[
1
]
&
FATTR4_WORD1_TIME_ACCESS_SET
)
{
if
(
bmval
[
1
]
&
FATTR4_WORD1_TIME_ACCESS_SET
)
{
READ_BUF
(
4
);
u32
set_it
;
dummy32
=
be32_to_cpup
(
p
++
);
switch
(
dummy32
)
{
if
(
xdr_stream_decode_u32
(
argp
->
xdr
,
&
set_it
)
<
0
)
return
nfserr_bad_xdr
;
switch
(
set_it
)
{
case
NFS4_SET_TO_CLIENT_TIME
:
case
NFS4_SET_TO_CLIENT_TIME
:
status
=
nfsd4_decode_
time
(
argp
,
&
iattr
->
ia_atime
);
status
=
nfsd4_decode_
nfstime4
(
argp
,
&
iattr
->
ia_atime
);
if
(
status
)
if
(
status
)
return
status
;
return
status
;
iattr
->
ia_valid
|=
(
ATTR_ATIME
|
ATTR_ATIME_SET
);
iattr
->
ia_valid
|=
(
ATTR_ATIME
|
ATTR_ATIME_SET
);
...
@@ -401,15 +418,17 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,
...
@@ -401,15 +418,17 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,
iattr
->
ia_valid
|=
ATTR_ATIME
;
iattr
->
ia_valid
|=
ATTR_ATIME
;
break
;
break
;
default:
default:
goto
xdr_erro
r
;
return
nfserr_bad_xd
r
;
}
}
}
}
if
(
bmval
[
1
]
&
FATTR4_WORD1_TIME_MODIFY_SET
)
{
if
(
bmval
[
1
]
&
FATTR4_WORD1_TIME_MODIFY_SET
)
{
READ_BUF
(
4
);
u32
set_it
;
dummy32
=
be32_to_cpup
(
p
++
);
switch
(
dummy32
)
{
if
(
xdr_stream_decode_u32
(
argp
->
xdr
,
&
set_it
)
<
0
)
return
nfserr_bad_xdr
;
switch
(
set_it
)
{
case
NFS4_SET_TO_CLIENT_TIME
:
case
NFS4_SET_TO_CLIENT_TIME
:
status
=
nfsd4_decode_
time
(
argp
,
&
iattr
->
ia_mtime
);
status
=
nfsd4_decode_
nfstime4
(
argp
,
&
iattr
->
ia_mtime
);
if
(
status
)
if
(
status
)
return
status
;
return
status
;
iattr
->
ia_valid
|=
(
ATTR_MTIME
|
ATTR_MTIME_SET
);
iattr
->
ia_valid
|=
(
ATTR_MTIME
|
ATTR_MTIME_SET
);
...
@@ -418,7 +437,7 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,
...
@@ -418,7 +437,7 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,
iattr
->
ia_valid
|=
ATTR_MTIME
;
iattr
->
ia_valid
|=
ATTR_MTIME
;
break
;
break
;
default:
default:
goto
xdr_erro
r
;
return
nfserr_bad_xd
r
;
}
}
}
}
...
...
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