Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xiphi1978
linux
提交
62250b3b
L
linux
项目概览
xiphi1978
/
linux
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
62250b3b
编写于
8月 24, 2006
作者:
G
Greg Kroah-Hartman
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'fixes' of
git://git.linux-nfs.org/pub/linux/nfs-2.6
上级
428a7e3e
a969fd5a
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
125 addition
and
90 deletion
+125
-90
fs/exec.c
fs/exec.c
+0
-8
fs/lockd/svcsubs.c
fs/lockd/svcsubs.c
+9
-6
fs/namei.c
fs/namei.c
+10
-1
fs/nfs/file.c
fs/nfs/file.c
+7
-1
fs/nfs/idmap.c
fs/nfs/idmap.c
+1
-3
fs/nfs/nfs4proc.c
fs/nfs/nfs4proc.c
+27
-2
fs/nfs/nfs4xdr.c
fs/nfs/nfs4xdr.c
+11
-10
fs/nfs/read.c
fs/nfs/read.c
+15
-8
include/linux/nfs_xdr.h
include/linux/nfs_xdr.h
+1
-1
include/linux/sunrpc/rpc_pipe_fs.h
include/linux/sunrpc/rpc_pipe_fs.h
+2
-2
include/linux/sunrpc/xprt.h
include/linux/sunrpc/xprt.h
+1
-1
net/sunrpc/auth_gss/auth_gss.c
net/sunrpc/auth_gss/auth_gss.c
+1
-2
net/sunrpc/clnt.c
net/sunrpc/clnt.c
+19
-11
net/sunrpc/rpc_pipe.c
net/sunrpc/rpc_pipe.c
+21
-34
未找到文件。
fs/exec.c
浏览文件 @
62250b3b
...
...
@@ -486,8 +486,6 @@ struct file *open_exec(const char *name)
if
(
!
(
nd
.
mnt
->
mnt_flags
&
MNT_NOEXEC
)
&&
S_ISREG
(
inode
->
i_mode
))
{
int
err
=
vfs_permission
(
&
nd
,
MAY_EXEC
);
if
(
!
err
&&
!
(
inode
->
i_mode
&
0111
))
err
=
-
EACCES
;
file
=
ERR_PTR
(
err
);
if
(
!
err
)
{
file
=
nameidata_to_filp
(
&
nd
,
O_RDONLY
);
...
...
@@ -922,12 +920,6 @@ int prepare_binprm(struct linux_binprm *bprm)
int
retval
;
mode
=
inode
->
i_mode
;
/*
* Check execute perms again - if the caller has CAP_DAC_OVERRIDE,
* generic_permission lets a non-executable through
*/
if
(
!
(
mode
&
0111
))
/* with at least _one_ execute bit set */
return
-
EACCES
;
if
(
bprm
->
file
->
f_op
==
NULL
)
return
-
EACCES
;
...
...
fs/lockd/svcsubs.c
浏览文件 @
62250b3b
...
...
@@ -237,19 +237,22 @@ static int
nlm_traverse_files
(
struct
nlm_host
*
host
,
int
action
)
{
struct
nlm_file
*
file
,
**
fp
;
int
i
;
int
i
,
ret
=
0
;
mutex_lock
(
&
nlm_file_mutex
);
for
(
i
=
0
;
i
<
FILE_NRHASH
;
i
++
)
{
fp
=
nlm_files
+
i
;
while
((
file
=
*
fp
)
!=
NULL
)
{
file
->
f_count
++
;
mutex_unlock
(
&
nlm_file_mutex
);
/* Traverse locks, blocks and shares of this file
* and update file->f_locks count */
if
(
nlm_inspect_file
(
host
,
file
,
action
))
{
mutex_unlock
(
&
nlm_file_mutex
);
return
1
;
}
if
(
nlm_inspect_file
(
host
,
file
,
action
))
ret
=
1
;
mutex_lock
(
&
nlm_file_mutex
);
file
->
f_count
--
;
/* No more references to this file. Let go of it. */
if
(
!
file
->
f_blocks
&&
!
file
->
f_locks
&&
!
file
->
f_shares
&&
!
file
->
f_count
)
{
...
...
@@ -262,7 +265,7 @@ nlm_traverse_files(struct nlm_host *host, int action)
}
}
mutex_unlock
(
&
nlm_file_mutex
);
return
0
;
return
ret
;
}
/*
...
...
fs/namei.c
浏览文件 @
62250b3b
...
...
@@ -227,10 +227,10 @@ int generic_permission(struct inode *inode, int mask,
int
permission
(
struct
inode
*
inode
,
int
mask
,
struct
nameidata
*
nd
)
{
umode_t
mode
=
inode
->
i_mode
;
int
retval
,
submask
;
if
(
mask
&
MAY_WRITE
)
{
umode_t
mode
=
inode
->
i_mode
;
/*
* Nobody gets write access to a read-only fs.
...
...
@@ -247,6 +247,13 @@ int permission(struct inode *inode, int mask, struct nameidata *nd)
}
/*
* MAY_EXEC on regular files requires special handling: We override
* filesystem execute permissions if the mode bits aren't set.
*/
if
((
mask
&
MAY_EXEC
)
&&
S_ISREG
(
mode
)
&&
!
(
mode
&
S_IXUGO
))
return
-
EACCES
;
/* Ordinary permission routines do not understand MAY_APPEND. */
submask
=
mask
&
~
MAY_APPEND
;
if
(
inode
->
i_op
&&
inode
->
i_op
->
permission
)
...
...
@@ -1767,6 +1774,8 @@ struct dentry *lookup_create(struct nameidata *nd, int is_dir)
if
(
nd
->
last_type
!=
LAST_NORM
)
goto
fail
;
nd
->
flags
&=
~
LOOKUP_PARENT
;
nd
->
flags
|=
LOOKUP_CREATE
;
nd
->
intent
.
open
.
flags
=
O_EXCL
;
/*
* Do the final lookup.
...
...
fs/nfs/file.c
浏览文件 @
62250b3b
...
...
@@ -312,7 +312,13 @@ static void nfs_invalidate_page(struct page *page, unsigned long offset)
static
int
nfs_release_page
(
struct
page
*
page
,
gfp_t
gfp
)
{
return
!
nfs_wb_page
(
page
->
mapping
->
host
,
page
);
if
(
gfp
&
__GFP_FS
)
return
!
nfs_wb_page
(
page
->
mapping
->
host
,
page
);
else
/*
* Avoid deadlock on nfs_wait_on_request().
*/
return
0
;
}
const
struct
address_space_operations
nfs_file_aops
=
{
...
...
fs/nfs/idmap.c
浏览文件 @
62250b3b
...
...
@@ -130,9 +130,7 @@ nfs_idmap_delete(struct nfs4_client *clp)
if
(
!
idmap
)
return
;
dput
(
idmap
->
idmap_dentry
);
idmap
->
idmap_dentry
=
NULL
;
rpc_unlink
(
idmap
->
idmap_path
);
rpc_unlink
(
idmap
->
idmap_dentry
);
clp
->
cl_idmap
=
NULL
;
kfree
(
idmap
);
}
...
...
fs/nfs/nfs4proc.c
浏览文件 @
62250b3b
...
...
@@ -2668,7 +2668,7 @@ static void nfs4_write_cached_acl(struct inode *inode, const char *buf, size_t a
nfs4_set_cached_acl
(
inode
,
acl
);
}
static
inline
ssize_t
nfs4_get_acl_uncached
(
struct
inode
*
inode
,
void
*
buf
,
size_t
buflen
)
static
ssize_t
__
nfs4_get_acl_uncached
(
struct
inode
*
inode
,
void
*
buf
,
size_t
buflen
)
{
struct
page
*
pages
[
NFS4ACL_MAXPAGES
];
struct
nfs_getaclargs
args
=
{
...
...
@@ -2721,6 +2721,19 @@ static inline ssize_t nfs4_get_acl_uncached(struct inode *inode, void *buf, size
return
ret
;
}
static
ssize_t
nfs4_get_acl_uncached
(
struct
inode
*
inode
,
void
*
buf
,
size_t
buflen
)
{
struct
nfs4_exception
exception
=
{
};
ssize_t
ret
;
do
{
ret
=
__nfs4_get_acl_uncached
(
inode
,
buf
,
buflen
);
if
(
ret
>=
0
)
break
;
ret
=
nfs4_handle_exception
(
NFS_SERVER
(
inode
),
ret
,
&
exception
);
}
while
(
exception
.
retry
);
return
ret
;
}
static
ssize_t
nfs4_proc_get_acl
(
struct
inode
*
inode
,
void
*
buf
,
size_t
buflen
)
{
struct
nfs_server
*
server
=
NFS_SERVER
(
inode
);
...
...
@@ -2737,7 +2750,7 @@ static ssize_t nfs4_proc_get_acl(struct inode *inode, void *buf, size_t buflen)
return
nfs4_get_acl_uncached
(
inode
,
buf
,
buflen
);
}
static
int
nfs4_proc_set_acl
(
struct
inode
*
inode
,
const
void
*
buf
,
size_t
buflen
)
static
int
__
nfs4_proc_set_acl
(
struct
inode
*
inode
,
const
void
*
buf
,
size_t
buflen
)
{
struct
nfs_server
*
server
=
NFS_SERVER
(
inode
);
struct
page
*
pages
[
NFS4ACL_MAXPAGES
];
...
...
@@ -2763,6 +2776,18 @@ static int nfs4_proc_set_acl(struct inode *inode, const void *buf, size_t buflen
return
ret
;
}
static
int
nfs4_proc_set_acl
(
struct
inode
*
inode
,
const
void
*
buf
,
size_t
buflen
)
{
struct
nfs4_exception
exception
=
{
};
int
err
;
do
{
err
=
nfs4_handle_exception
(
NFS_SERVER
(
inode
),
__nfs4_proc_set_acl
(
inode
,
buf
,
buflen
),
&
exception
);
}
while
(
exception
.
retry
);
return
err
;
}
static
int
nfs4_async_handle_error
(
struct
rpc_task
*
task
,
const
struct
nfs_server
*
server
)
{
...
...
fs/nfs/nfs4xdr.c
浏览文件 @
62250b3b
...
...
@@ -3355,7 +3355,7 @@ static int decode_readdir(struct xdr_stream *xdr, struct rpc_rqst *req, struct n
struct
kvec
*
iov
=
rcvbuf
->
head
;
unsigned
int
nr
,
pglen
=
rcvbuf
->
page_len
;
uint32_t
*
end
,
*
entry
,
*
p
,
*
kaddr
;
uint32_t
len
,
attrlen
;
uint32_t
len
,
attrlen
,
xlen
;
int
hdrlen
,
recvd
,
status
;
status
=
decode_op_hdr
(
xdr
,
OP_READDIR
);
...
...
@@ -3377,10 +3377,10 @@ static int decode_readdir(struct xdr_stream *xdr, struct rpc_rqst *req, struct n
BUG_ON
(
pglen
+
readdir
->
pgbase
>
PAGE_CACHE_SIZE
);
kaddr
=
p
=
(
uint32_t
*
)
kmap_atomic
(
page
,
KM_USER0
);
end
=
(
uint32_t
*
)
((
char
*
)
p
+
pglen
+
readdir
->
pgbase
);
end
=
p
+
((
pglen
+
readdir
->
pgbase
)
>>
2
);
entry
=
p
;
for
(
nr
=
0
;
*
p
++
;
nr
++
)
{
if
(
p
+
3
>
end
)
if
(
end
-
p
<
3
)
goto
short_pkt
;
dprintk
(
"cookie = %Lu, "
,
*
((
unsigned
long
long
*
)
p
));
p
+=
2
;
/* cookie */
...
...
@@ -3389,18 +3389,19 @@ static int decode_readdir(struct xdr_stream *xdr, struct rpc_rqst *req, struct n
printk
(
KERN_WARNING
"NFS: giant filename in readdir (len 0x%x)
\n
"
,
len
);
goto
err_unmap
;
}
dprintk
(
"filename = %*s
\n
"
,
len
,
(
char
*
)
p
);
p
+=
XDR_QUADLEN
(
len
);
if
(
p
+
1
>
end
)
xlen
=
XDR_QUADLEN
(
len
);
if
(
end
-
p
<
xlen
+
1
)
goto
short_pkt
;
dprintk
(
"filename = %*s
\n
"
,
len
,
(
char
*
)
p
);
p
+=
xlen
;
len
=
ntohl
(
*
p
++
);
/* bitmap length */
p
+=
len
;
if
(
p
+
1
>
end
)
if
(
end
-
p
<
len
+
1
)
goto
short_pkt
;
p
+=
len
;
attrlen
=
XDR_QUADLEN
(
ntohl
(
*
p
++
));
p
+=
attrlen
;
/* attributes */
if
(
p
+
2
>
end
)
if
(
end
-
p
<
attrlen
+
2
)
goto
short_pkt
;
p
+=
attrlen
;
/* attributes */
entry
=
p
;
}
if
(
!
nr
&&
(
entry
[
0
]
!=
0
||
entry
[
1
]
==
0
))
...
...
fs/nfs/read.c
浏览文件 @
62250b3b
...
...
@@ -116,10 +116,17 @@ static void nfs_readpage_truncate_uninitialised_page(struct nfs_read_data *data)
pages
=
&
data
->
args
.
pages
[
base
>>
PAGE_CACHE_SHIFT
];
base
&=
~
PAGE_CACHE_MASK
;
pglen
=
PAGE_CACHE_SIZE
-
base
;
if
(
pglen
<
remainder
)
for
(;;)
{
if
(
remainder
<=
pglen
)
{
memclear_highpage_flush
(
*
pages
,
base
,
remainder
);
break
;
}
memclear_highpage_flush
(
*
pages
,
base
,
pglen
);
else
memclear_highpage_flush
(
*
pages
,
base
,
remainder
);
pages
++
;
remainder
-=
pglen
;
pglen
=
PAGE_CACHE_SIZE
;
base
=
0
;
}
}
/*
...
...
@@ -476,6 +483,8 @@ static void nfs_readpage_set_pages_uptodate(struct nfs_read_data *data)
unsigned
int
base
=
data
->
args
.
pgbase
;
struct
page
**
pages
;
if
(
data
->
res
.
eof
)
count
=
data
->
args
.
count
;
if
(
unlikely
(
count
==
0
))
return
;
pages
=
&
data
->
args
.
pages
[
base
>>
PAGE_CACHE_SHIFT
];
...
...
@@ -483,11 +492,7 @@ static void nfs_readpage_set_pages_uptodate(struct nfs_read_data *data)
count
+=
base
;
for
(;
count
>=
PAGE_CACHE_SIZE
;
count
-=
PAGE_CACHE_SIZE
,
pages
++
)
SetPageUptodate
(
*
pages
);
/*
* Was this an eof or a short read? If the latter, don't mark the page
* as uptodate yet.
*/
if
(
count
>
0
&&
(
data
->
res
.
eof
||
data
->
args
.
count
==
data
->
res
.
count
))
if
(
count
!=
0
)
SetPageUptodate
(
*
pages
);
}
...
...
@@ -502,6 +507,8 @@ static void nfs_readpage_set_pages_error(struct nfs_read_data *data)
count
+=
base
;
for
(;
count
>=
PAGE_CACHE_SIZE
;
count
-=
PAGE_CACHE_SIZE
,
pages
++
)
SetPageError
(
*
pages
);
if
(
count
!=
0
)
SetPageError
(
*
pages
);
}
/*
...
...
include/linux/nfs_xdr.h
浏览文件 @
62250b3b
...
...
@@ -659,7 +659,7 @@ struct nfs4_rename_res {
struct
nfs4_setclientid
{
const
nfs4_verifier
*
sc_verifier
;
/* request */
unsigned
int
sc_name_len
;
char
sc_name
[
32
];
/* request */
char
sc_name
[
48
];
/* request */
u32
sc_prog
;
/* request */
unsigned
int
sc_netid_len
;
char
sc_netid
[
4
];
/* request */
...
...
include/linux/sunrpc/rpc_pipe_fs.h
浏览文件 @
62250b3b
...
...
@@ -42,9 +42,9 @@ RPC_I(struct inode *inode)
extern
int
rpc_queue_upcall
(
struct
inode
*
,
struct
rpc_pipe_msg
*
);
extern
struct
dentry
*
rpc_mkdir
(
char
*
,
struct
rpc_clnt
*
);
extern
int
rpc_rmdir
(
char
*
);
extern
int
rpc_rmdir
(
struct
dentry
*
);
extern
struct
dentry
*
rpc_mkpipe
(
char
*
,
void
*
,
struct
rpc_pipe_ops
*
,
int
flags
);
extern
int
rpc_unlink
(
char
*
);
extern
int
rpc_unlink
(
struct
dentry
*
);
extern
struct
vfsmount
*
rpc_get_mount
(
void
);
extern
void
rpc_put_mount
(
void
);
...
...
include/linux/sunrpc/xprt.h
浏览文件 @
62250b3b
...
...
@@ -37,7 +37,7 @@ extern unsigned int xprt_max_resvport;
#define RPC_MIN_RESVPORT (1U)
#define RPC_MAX_RESVPORT (65535U)
#define RPC_DEF_MIN_RESVPORT (6
50
U)
#define RPC_DEF_MIN_RESVPORT (6
65
U)
#define RPC_DEF_MAX_RESVPORT (1023U)
/*
...
...
net/sunrpc/auth_gss/auth_gss.c
浏览文件 @
62250b3b
...
...
@@ -718,8 +718,7 @@ gss_destroy(struct rpc_auth *auth)
auth
,
auth
->
au_flavor
);
gss_auth
=
container_of
(
auth
,
struct
gss_auth
,
rpc_auth
);
rpc_unlink
(
gss_auth
->
path
);
dput
(
gss_auth
->
dentry
);
rpc_unlink
(
gss_auth
->
dentry
);
gss_auth
->
dentry
=
NULL
;
gss_mech_put
(
gss_auth
->
mech
);
...
...
net/sunrpc/clnt.c
浏览文件 @
62250b3b
...
...
@@ -183,8 +183,7 @@ rpc_new_client(struct rpc_xprt *xprt, char *servname,
out_no_auth:
if
(
!
IS_ERR
(
clnt
->
cl_dentry
))
{
rpc_rmdir
(
clnt
->
cl_pathname
);
dput
(
clnt
->
cl_dentry
);
rpc_rmdir
(
clnt
->
cl_dentry
);
rpc_put_mount
();
}
out_no_path:
...
...
@@ -251,10 +250,8 @@ rpc_clone_client(struct rpc_clnt *clnt)
new
->
cl_autobind
=
0
;
new
->
cl_oneshot
=
0
;
new
->
cl_dead
=
0
;
if
(
!
IS_ERR
(
new
->
cl_dentry
))
{
if
(
!
IS_ERR
(
new
->
cl_dentry
))
dget
(
new
->
cl_dentry
);
rpc_get_mount
();
}
rpc_init_rtt
(
&
new
->
cl_rtt_default
,
clnt
->
cl_xprt
->
timeout
.
to_initval
);
if
(
new
->
cl_auth
)
atomic_inc
(
&
new
->
cl_auth
->
au_count
);
...
...
@@ -317,11 +314,15 @@ rpc_destroy_client(struct rpc_clnt *clnt)
clnt
->
cl_auth
=
NULL
;
}
if
(
clnt
->
cl_parent
!=
clnt
)
{
if
(
!
IS_ERR
(
clnt
->
cl_dentry
))
dput
(
clnt
->
cl_dentry
);
rpc_destroy_client
(
clnt
->
cl_parent
);
goto
out_free
;
}
if
(
clnt
->
cl_pathname
[
0
])
rpc_rmdir
(
clnt
->
cl_pathname
);
if
(
!
IS_ERR
(
clnt
->
cl_dentry
))
{
rpc_rmdir
(
clnt
->
cl_dentry
);
rpc_put_mount
();
}
if
(
clnt
->
cl_xprt
)
{
xprt_destroy
(
clnt
->
cl_xprt
);
clnt
->
cl_xprt
=
NULL
;
...
...
@@ -331,10 +332,6 @@ rpc_destroy_client(struct rpc_clnt *clnt)
out_free:
rpc_free_iostats
(
clnt
->
cl_metrics
);
clnt
->
cl_metrics
=
NULL
;
if
(
!
IS_ERR
(
clnt
->
cl_dentry
))
{
dput
(
clnt
->
cl_dentry
);
rpc_put_mount
();
}
kfree
(
clnt
);
return
0
;
}
...
...
@@ -1184,6 +1181,17 @@ call_verify(struct rpc_task *task)
u32
*
p
=
iov
->
iov_base
,
n
;
int
error
=
-
EACCES
;
if
((
task
->
tk_rqstp
->
rq_rcv_buf
.
len
&
3
)
!=
0
)
{
/* RFC-1014 says that the representation of XDR data must be a
* multiple of four bytes
* - if it isn't pointer subtraction in the NFS client may give
* undefined results
*/
printk
(
KERN_WARNING
"call_verify: XDR representation not a multiple of"
" 4 bytes: 0x%x
\n
"
,
task
->
tk_rqstp
->
rq_rcv_buf
.
len
);
goto
out_eio
;
}
if
((
len
-=
3
)
<
0
)
goto
out_overflow
;
p
+=
1
;
/* skip XID */
...
...
net/sunrpc/rpc_pipe.c
浏览文件 @
62250b3b
...
...
@@ -539,6 +539,7 @@ rpc_depopulate(struct dentry *parent)
rpc_close_pipes
(
dentry
->
d_inode
);
simple_unlink
(
dir
,
dentry
);
}
inode_dir_notify
(
dir
,
DN_DELETE
);
dput
(
dentry
);
}
while
(
n
);
goto
repeat
;
...
...
@@ -610,8 +611,8 @@ __rpc_rmdir(struct inode *dir, struct dentry *dentry)
int
error
;
shrink_dcache_parent
(
dentry
);
if
(
d
entry
->
d_inode
)
r
pc_close_pipes
(
dentry
->
d_inode
)
;
if
(
d
_unhashed
(
dentry
)
)
r
eturn
0
;
if
((
error
=
simple_rmdir
(
dir
,
dentry
))
!=
0
)
return
error
;
if
(
!
error
)
{
...
...
@@ -684,28 +685,20 @@ rpc_mkdir(char *path, struct rpc_clnt *rpc_client)
}
int
rpc_rmdir
(
char
*
path
)
rpc_rmdir
(
struct
dentry
*
dentry
)
{
struct
nameidata
nd
;
struct
dentry
*
dentry
;
struct
dentry
*
parent
;
struct
inode
*
dir
;
int
error
;
if
((
error
=
rpc_lookup_parent
(
path
,
&
nd
))
!=
0
)
return
error
;
dir
=
nd
.
dentry
->
d_inode
;
parent
=
dget_parent
(
dentry
);
dir
=
parent
->
d_inode
;
mutex_lock_nested
(
&
dir
->
i_mutex
,
I_MUTEX_PARENT
);
dentry
=
lookup_one_len
(
nd
.
last
.
name
,
nd
.
dentry
,
nd
.
last
.
len
);
if
(
IS_ERR
(
dentry
))
{
error
=
PTR_ERR
(
dentry
);
goto
out_release
;
}
rpc_depopulate
(
dentry
);
error
=
__rpc_rmdir
(
dir
,
dentry
);
dput
(
dentry
);
out_release:
mutex_unlock
(
&
dir
->
i_mutex
);
rpc_release_path
(
&
nd
);
dput
(
parent
);
return
error
;
}
...
...
@@ -746,32 +739,26 @@ rpc_mkpipe(char *path, void *private, struct rpc_pipe_ops *ops, int flags)
}
int
rpc_unlink
(
char
*
path
)
rpc_unlink
(
struct
dentry
*
dentry
)
{
struct
nameidata
nd
;
struct
dentry
*
dentry
;
struct
dentry
*
parent
;
struct
inode
*
dir
;
int
error
;
int
error
=
0
;
if
((
error
=
rpc_lookup_parent
(
path
,
&
nd
))
!=
0
)
return
error
;
dir
=
nd
.
dentry
->
d_inode
;
parent
=
dget_parent
(
dentry
);
dir
=
parent
->
d_inode
;
mutex_lock_nested
(
&
dir
->
i_mutex
,
I_MUTEX_PARENT
);
dentry
=
lookup_one_len
(
nd
.
last
.
name
,
nd
.
dentry
,
nd
.
last
.
len
);
if
(
IS_ERR
(
dentry
))
{
error
=
PTR_ERR
(
dentry
);
goto
out_release
;
}
d_drop
(
dentry
);
if
(
dentry
->
d_inode
)
{
rpc_close_pipes
(
dentry
->
d_inode
);
error
=
simple_unlink
(
dir
,
dentry
);
if
(
!
d_unhashed
(
dentry
))
{
d_drop
(
dentry
);
if
(
dentry
->
d_inode
)
{
rpc_close_pipes
(
dentry
->
d_inode
);
error
=
simple_unlink
(
dir
,
dentry
);
}
inode_dir_notify
(
dir
,
DN_DELETE
);
}
dput
(
dentry
);
inode_dir_notify
(
dir
,
DN_DELETE
);
out_release:
mutex_unlock
(
&
dir
->
i_mutex
);
rpc_release_path
(
&
nd
);
dput
(
parent
);
return
error
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录