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
ebcd8e8b
Commit
ebcd8e8b
authored
Oct 21, 2020
by
Chuck Lever
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFSD: Update the NFSv2 GETATTR argument decoder to use struct xdr_stream
Signed-off-by:
Chuck Lever
<
chuck.lever@oracle.com
>
parent
f8a38e2d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
9 deletions
+23
-9
fs/nfsd/nfsproc.c
fs/nfsd/nfsproc.c
+2
-2
fs/nfsd/nfsxdr.c
fs/nfsd/nfsxdr.c
+20
-6
fs/nfsd/xdr.h
fs/nfsd/xdr.h
+1
-1
No files found.
fs/nfsd/nfsproc.c
View file @
ebcd8e8b
...
@@ -627,7 +627,7 @@ static const struct svc_procedure nfsd_procedures2[18] = {
...
@@ -627,7 +627,7 @@ static const struct svc_procedure nfsd_procedures2[18] = {
},
},
[
NFSPROC_GETATTR
]
=
{
[
NFSPROC_GETATTR
]
=
{
.
pc_func
=
nfsd_proc_getattr
,
.
pc_func
=
nfsd_proc_getattr
,
.
pc_decode
=
nfssvc_decode_fhandle
,
.
pc_decode
=
nfssvc_decode_fhandle
args
,
.
pc_encode
=
nfssvc_encode_attrstat
,
.
pc_encode
=
nfssvc_encode_attrstat
,
.
pc_release
=
nfssvc_release_attrstat
,
.
pc_release
=
nfssvc_release_attrstat
,
.
pc_argsize
=
sizeof
(
struct
nfsd_fhandle
),
.
pc_argsize
=
sizeof
(
struct
nfsd_fhandle
),
...
@@ -793,7 +793,7 @@ static const struct svc_procedure nfsd_procedures2[18] = {
...
@@ -793,7 +793,7 @@ static const struct svc_procedure nfsd_procedures2[18] = {
},
},
[
NFSPROC_STATFS
]
=
{
[
NFSPROC_STATFS
]
=
{
.
pc_func
=
nfsd_proc_statfs
,
.
pc_func
=
nfsd_proc_statfs
,
.
pc_decode
=
nfssvc_decode_fhandle
,
.
pc_decode
=
nfssvc_decode_fhandle
args
,
.
pc_encode
=
nfssvc_encode_statfsres
,
.
pc_encode
=
nfssvc_encode_statfsres
,
.
pc_argsize
=
sizeof
(
struct
nfsd_fhandle
),
.
pc_argsize
=
sizeof
(
struct
nfsd_fhandle
),
.
pc_ressize
=
sizeof
(
struct
nfsd_statfsres
),
.
pc_ressize
=
sizeof
(
struct
nfsd_statfsres
),
...
...
fs/nfsd/nfsxdr.c
View file @
ebcd8e8b
...
@@ -23,8 +23,9 @@ static u32 nfs_ftypes[] = {
...
@@ -23,8 +23,9 @@ static u32 nfs_ftypes[] = {
/*
/*
*
XDR functions for basic NFS types
*
Basic NFSv2 data types (RFC 1094 Section 2.3)
*/
*/
static
__be32
*
static
__be32
*
decode_fh
(
__be32
*
p
,
struct
svc_fh
*
fhp
)
decode_fh
(
__be32
*
p
,
struct
svc_fh
*
fhp
)
{
{
...
@@ -37,6 +38,21 @@ decode_fh(__be32 *p, struct svc_fh *fhp)
...
@@ -37,6 +38,21 @@ decode_fh(__be32 *p, struct svc_fh *fhp)
return
p
+
(
NFS_FHSIZE
>>
2
);
return
p
+
(
NFS_FHSIZE
>>
2
);
}
}
static
bool
svcxdr_decode_fhandle
(
struct
xdr_stream
*
xdr
,
struct
svc_fh
*
fhp
)
{
__be32
*
p
;
p
=
xdr_inline_decode
(
xdr
,
NFS_FHSIZE
);
if
(
!
p
)
return
false
;
fh_init
(
fhp
,
NFS_FHSIZE
);
memcpy
(
&
fhp
->
fh_handle
.
fh_base
,
p
,
NFS_FHSIZE
);
fhp
->
fh_handle
.
fh_size
=
NFS_FHSIZE
;
return
true
;
}
/* Helper function for NFSv2 ACL code */
/* Helper function for NFSv2 ACL code */
__be32
*
nfs2svc_decode_fh
(
__be32
*
p
,
struct
svc_fh
*
fhp
)
__be32
*
nfs2svc_decode_fh
(
__be32
*
p
,
struct
svc_fh
*
fhp
)
{
{
...
@@ -194,14 +210,12 @@ __be32 *nfs2svc_encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *f
...
@@ -194,14 +210,12 @@ __be32 *nfs2svc_encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *f
*/
*/
int
int
nfssvc_decode_fhandle
(
struct
svc_rqst
*
rqstp
,
__be32
*
p
)
nfssvc_decode_fhandle
args
(
struct
svc_rqst
*
rqstp
,
__be32
*
p
)
{
{
struct
xdr_stream
*
xdr
=
&
rqstp
->
rq_arg_stream
;
struct
nfsd_fhandle
*
args
=
rqstp
->
rq_argp
;
struct
nfsd_fhandle
*
args
=
rqstp
->
rq_argp
;
p
=
decode_fh
(
p
,
&
args
->
fh
);
return
svcxdr_decode_fhandle
(
xdr
,
&
args
->
fh
);
if
(
!
p
)
return
0
;
return
xdr_argsize_check
(
rqstp
,
p
);
}
}
int
int
...
...
fs/nfsd/xdr.h
View file @
ebcd8e8b
...
@@ -144,7 +144,7 @@ union nfsd_xdrstore {
...
@@ -144,7 +144,7 @@ union nfsd_xdrstore {
#define NFS2_SVC_XDRSIZE sizeof(union nfsd_xdrstore)
#define NFS2_SVC_XDRSIZE sizeof(union nfsd_xdrstore)
int
nfssvc_decode_fhandle
(
struct
svc_rqst
*
,
__be32
*
);
int
nfssvc_decode_fhandle
args
(
struct
svc_rqst
*
,
__be32
*
);
int
nfssvc_decode_sattrargs
(
struct
svc_rqst
*
,
__be32
*
);
int
nfssvc_decode_sattrargs
(
struct
svc_rqst
*
,
__be32
*
);
int
nfssvc_decode_diropargs
(
struct
svc_rqst
*
,
__be32
*
);
int
nfssvc_decode_diropargs
(
struct
svc_rqst
*
,
__be32
*
);
int
nfssvc_decode_readargs
(
struct
svc_rqst
*
,
__be32
*
);
int
nfssvc_decode_readargs
(
struct
svc_rqst
*
,
__be32
*
);
...
...
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