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
nexedi
linux
Commits
4d7edbc3
Commit
4d7edbc3
authored
May 27, 2017
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nfsd_readlink(): switch to vfs_get_link()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
10428957
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
23 deletions
+16
-23
fs/nfsd/vfs.c
fs/nfsd/vfs.c
+16
-23
No files found.
fs/nfsd/vfs.c
View file @
4d7edbc3
...
@@ -1464,41 +1464,34 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
...
@@ -1464,41 +1464,34 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
__be32
__be32
nfsd_readlink
(
struct
svc_rqst
*
rqstp
,
struct
svc_fh
*
fhp
,
char
*
buf
,
int
*
lenp
)
nfsd_readlink
(
struct
svc_rqst
*
rqstp
,
struct
svc_fh
*
fhp
,
char
*
buf
,
int
*
lenp
)
{
{
mm_segment_t
oldfs
;
__be32
err
;
__be32
err
;
int
host_err
;
const
char
*
link
;
struct
path
path
;
struct
path
path
;
DEFINE_DELAYED_CALL
(
done
);
int
len
;
err
=
fh_verify
(
rqstp
,
fhp
,
S_IFLNK
,
NFSD_MAY_NOP
);
err
=
fh_verify
(
rqstp
,
fhp
,
S_IFLNK
,
NFSD_MAY_NOP
);
if
(
err
)
if
(
unlikely
(
err
)
)
goto
out
;
return
err
;
path
.
mnt
=
fhp
->
fh_export
->
ex_path
.
mnt
;
path
.
mnt
=
fhp
->
fh_export
->
ex_path
.
mnt
;
path
.
dentry
=
fhp
->
fh_dentry
;
path
.
dentry
=
fhp
->
fh_dentry
;
err
=
nfserr_inval
;
if
(
unlikely
(
!
d_is_symlink
(
path
.
dentry
)))
if
(
!
d_is_symlink
(
path
.
dentry
))
return
nfserr_inval
;
goto
out
;
touch_atime
(
&
path
);
touch_atime
(
&
path
);
/* N.B. Why does this call need a get_fs()??
* Remove the set_fs and watch the fireworks:-) --okir
*/
oldfs
=
get_fs
();
set_fs
(
KERNEL_DS
);
link
=
vfs_get_link
(
path
.
dentry
,
&
done
);
host_err
=
vfs_readlink
(
path
.
dentry
,
(
char
__user
*
)
buf
,
*
lenp
);
if
(
IS_ERR
(
link
))
set_fs
(
oldfs
);
return
nfserrno
(
PTR_ERR
(
link
)
);
if
(
host_err
<
0
)
len
=
strlen
(
link
);
goto
out_nfserr
;
if
(
len
<
*
lenp
)
*
lenp
=
host_err
;
*
lenp
=
len
;
err
=
0
;
memcpy
(
buf
,
link
,
*
lenp
);
out:
do_delayed_call
(
&
done
);
return
err
;
return
0
;
out_nfserr:
err
=
nfserrno
(
host_err
);
goto
out
;
}
}
/*
/*
...
...
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