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
91c9fa8f
Commit
91c9fa8f
authored
Apr 18, 2009
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch rqst_exp_get_by_name()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
5bf3bd2b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
27 deletions
+23
-27
fs/nfsd/export.c
fs/nfsd/export.c
+6
-9
fs/nfsd/vfs.c
fs/nfsd/vfs.c
+16
-16
include/linux/nfsd/export.h
include/linux/nfsd/export.h
+1
-2
No files found.
fs/nfsd/export.c
View file @
91c9fa8f
...
@@ -1240,18 +1240,15 @@ __be32 check_nfsd_access(struct svc_export *exp, struct svc_rqst *rqstp)
...
@@ -1240,18 +1240,15 @@ __be32 check_nfsd_access(struct svc_export *exp, struct svc_rqst *rqstp)
* use exp_get_by_name() or exp_find().
* use exp_get_by_name() or exp_find().
*/
*/
struct
svc_export
*
struct
svc_export
*
rqst_exp_get_by_name
(
struct
svc_rqst
*
rqstp
,
struct
vfsmount
*
mnt
,
rqst_exp_get_by_name
(
struct
svc_rqst
*
rqstp
,
struct
path
*
path
)
struct
dentry
*
dentry
)
{
{
struct
svc_export
*
gssexp
,
*
exp
=
ERR_PTR
(
-
ENOENT
);
struct
svc_export
*
gssexp
,
*
exp
=
ERR_PTR
(
-
ENOENT
);
struct
path
path
=
{.
mnt
=
mnt
,
.
dentry
=
dentry
};
if
(
rqstp
->
rq_client
==
NULL
)
if
(
rqstp
->
rq_client
==
NULL
)
goto
gss
;
goto
gss
;
/* First try the auth_unix client: */
/* First try the auth_unix client: */
exp
=
exp_get_by_name
(
rqstp
->
rq_client
,
&
path
,
exp
=
exp_get_by_name
(
rqstp
->
rq_client
,
path
,
&
rqstp
->
rq_chandle
);
&
rqstp
->
rq_chandle
);
if
(
PTR_ERR
(
exp
)
==
-
ENOENT
)
if
(
PTR_ERR
(
exp
)
==
-
ENOENT
)
goto
gss
;
goto
gss
;
if
(
IS_ERR
(
exp
))
if
(
IS_ERR
(
exp
))
...
@@ -1263,8 +1260,7 @@ rqst_exp_get_by_name(struct svc_rqst *rqstp, struct vfsmount *mnt,
...
@@ -1263,8 +1260,7 @@ rqst_exp_get_by_name(struct svc_rqst *rqstp, struct vfsmount *mnt,
/* Otherwise, try falling back on gss client */
/* Otherwise, try falling back on gss client */
if
(
rqstp
->
rq_gssclient
==
NULL
)
if
(
rqstp
->
rq_gssclient
==
NULL
)
return
exp
;
return
exp
;
gssexp
=
exp_get_by_name
(
rqstp
->
rq_gssclient
,
&
path
,
gssexp
=
exp_get_by_name
(
rqstp
->
rq_gssclient
,
path
,
&
rqstp
->
rq_chandle
);
&
rqstp
->
rq_chandle
);
if
(
PTR_ERR
(
gssexp
)
==
-
ENOENT
)
if
(
PTR_ERR
(
gssexp
)
==
-
ENOENT
)
return
exp
;
return
exp
;
if
(
!
IS_ERR
(
exp
))
if
(
!
IS_ERR
(
exp
))
...
@@ -1307,9 +1303,10 @@ rqst_exp_parent(struct svc_rqst *rqstp, struct vfsmount *mnt,
...
@@ -1307,9 +1303,10 @@ rqst_exp_parent(struct svc_rqst *rqstp, struct vfsmount *mnt,
struct
dentry
*
dentry
)
struct
dentry
*
dentry
)
{
{
struct
svc_export
*
exp
;
struct
svc_export
*
exp
;
struct
path
path
=
{.
mnt
=
mnt
,
.
dentry
=
dentry
};
dget
(
dentry
);
dget
(
dentry
);
exp
=
rqst_exp_get_by_name
(
rqstp
,
mnt
,
dentry
);
exp
=
rqst_exp_get_by_name
(
rqstp
,
&
path
);
while
(
PTR_ERR
(
exp
)
==
-
ENOENT
&&
!
IS_ROOT
(
dentry
))
{
while
(
PTR_ERR
(
exp
)
==
-
ENOENT
&&
!
IS_ROOT
(
dentry
))
{
struct
dentry
*
parent
;
struct
dentry
*
parent
;
...
@@ -1317,7 +1314,7 @@ rqst_exp_parent(struct svc_rqst *rqstp, struct vfsmount *mnt,
...
@@ -1317,7 +1314,7 @@ rqst_exp_parent(struct svc_rqst *rqstp, struct vfsmount *mnt,
parent
=
dget_parent
(
dentry
);
parent
=
dget_parent
(
dentry
);
dput
(
dentry
);
dput
(
dentry
);
dentry
=
parent
;
dentry
=
parent
;
exp
=
rqst_exp_get_by_name
(
rqstp
,
mnt
,
dentry
);
exp
=
rqst_exp_get_by_name
(
rqstp
,
&
path
);
}
}
dput
(
dentry
);
dput
(
dentry
);
return
exp
;
return
exp
;
...
...
fs/nfsd/vfs.c
View file @
91c9fa8f
...
@@ -101,36 +101,36 @@ nfsd_cross_mnt(struct svc_rqst *rqstp, struct dentry **dpp,
...
@@ -101,36 +101,36 @@ nfsd_cross_mnt(struct svc_rqst *rqstp, struct dentry **dpp,
{
{
struct
svc_export
*
exp
=
*
expp
,
*
exp2
=
NULL
;
struct
svc_export
*
exp
=
*
expp
,
*
exp2
=
NULL
;
struct
dentry
*
dentry
=
*
dpp
;
struct
dentry
*
dentry
=
*
dpp
;
struct
vfsmount
*
mnt
=
mntget
(
exp
->
ex_path
.
mnt
);
struct
path
path
=
{.
mnt
=
mntget
(
exp
->
ex_path
.
mnt
),
struct
dentry
*
mounts
=
dget
(
dentry
)
;
.
dentry
=
dget
(
dentry
)}
;
int
err
=
0
;
int
err
=
0
;
while
(
follow_down
(
&
mnt
,
&
mounts
)
&&
d_mountpoint
(
mounts
));
while
(
follow_down
(
&
path
.
mnt
,
&
path
.
dentry
)
&&
d_mountpoint
(
path
.
dentry
))
;
exp2
=
rqst_exp_get_by_name
(
rqstp
,
mnt
,
mounts
);
exp2
=
rqst_exp_get_by_name
(
rqstp
,
&
path
);
if
(
IS_ERR
(
exp2
))
{
if
(
IS_ERR
(
exp2
))
{
if
(
PTR_ERR
(
exp2
)
!=
-
ENOENT
)
if
(
PTR_ERR
(
exp2
)
!=
-
ENOENT
)
err
=
PTR_ERR
(
exp2
);
err
=
PTR_ERR
(
exp2
);
dput
(
mounts
);
path_put
(
&
path
);
mntput
(
mnt
);
goto
out
;
goto
out
;
}
}
if
((
exp
->
ex_flags
&
NFSEXP_CROSSMOUNT
)
||
EX_NOHIDE
(
exp2
))
{
if
((
exp
->
ex_flags
&
NFSEXP_CROSSMOUNT
)
||
EX_NOHIDE
(
exp2
))
{
/* successfully crossed mount point */
/* successfully crossed mount point */
/*
/*
* This is subtle: dentry is *not* under mnt at this point.
* This is subtle: path.dentry is *not* on path.mnt
* The only reason we are safe is that original mnt is pinned
* at this point. The only reason we are safe is that
* down by exp, so we should dput before putting exp.
* original mnt is pinned down by exp, so we should
* put path *before* putting exp
*/
*/
dput
(
dentry
);
*
dpp
=
path
.
dentry
;
*
dpp
=
mounts
;
path
.
dentry
=
dentry
;
exp_put
(
exp
);
*
expp
=
exp2
;
*
expp
=
exp2
;
}
else
{
exp2
=
exp
;
exp_put
(
exp2
);
dput
(
mounts
);
}
}
mntput
(
mnt
);
path_put
(
&
path
);
exp_put
(
exp2
);
out:
out:
return
err
;
return
err
;
}
}
...
...
include/linux/nfsd/export.h
View file @
91c9fa8f
...
@@ -125,8 +125,7 @@ void nfsd_export_flush(void);
...
@@ -125,8 +125,7 @@ void nfsd_export_flush(void);
void
exp_readlock
(
void
);
void
exp_readlock
(
void
);
void
exp_readunlock
(
void
);
void
exp_readunlock
(
void
);
struct
svc_export
*
rqst_exp_get_by_name
(
struct
svc_rqst
*
,
struct
svc_export
*
rqst_exp_get_by_name
(
struct
svc_rqst
*
,
struct
vfsmount
*
,
struct
path
*
);
struct
dentry
*
);
struct
svc_export
*
rqst_exp_parent
(
struct
svc_rqst
*
,
struct
svc_export
*
rqst_exp_parent
(
struct
svc_rqst
*
,
struct
vfsmount
*
mnt
,
struct
vfsmount
*
mnt
,
struct
dentry
*
dentry
);
struct
dentry
*
dentry
);
...
...
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