Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
54281548
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
54281548
编写于
3月 20, 2006
作者:
T
Trond Myklebust
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
SUNRPC: Fix a 'Busy inodes' error in rpc_pipefs
Signed-off-by:
N
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
上级
a9a80178
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
35 addition
and
14 deletion
+35
-14
include/linux/sunrpc/clnt.h
include/linux/sunrpc/clnt.h
+1
-0
include/linux/sunrpc/rpc_pipe_fs.h
include/linux/sunrpc/rpc_pipe_fs.h
+2
-0
net/sunrpc/clnt.c
net/sunrpc/clnt.c
+20
-4
net/sunrpc/rpc_pipe.c
net/sunrpc/rpc_pipe.c
+12
-10
未找到文件。
include/linux/sunrpc/clnt.h
浏览文件 @
54281548
...
@@ -60,6 +60,7 @@ struct rpc_clnt {
...
@@ -60,6 +60,7 @@ struct rpc_clnt {
int
cl_nodelen
;
/* nodename length */
int
cl_nodelen
;
/* nodename length */
char
cl_nodename
[
UNX_MAXNODENAME
];
char
cl_nodename
[
UNX_MAXNODENAME
];
char
cl_pathname
[
30
];
/* Path in rpc_pipe_fs */
char
cl_pathname
[
30
];
/* Path in rpc_pipe_fs */
struct
vfsmount
*
cl_vfsmnt
;
struct
dentry
*
cl_dentry
;
/* inode */
struct
dentry
*
cl_dentry
;
/* inode */
struct
rpc_clnt
*
cl_parent
;
/* Points to parent of clones */
struct
rpc_clnt
*
cl_parent
;
/* Points to parent of clones */
struct
rpc_rtt
cl_rtt_default
;
struct
rpc_rtt
cl_rtt_default
;
...
...
include/linux/sunrpc/rpc_pipe_fs.h
浏览文件 @
54281548
...
@@ -45,6 +45,8 @@ extern struct dentry *rpc_mkdir(char *, struct rpc_clnt *);
...
@@ -45,6 +45,8 @@ extern struct dentry *rpc_mkdir(char *, struct rpc_clnt *);
extern
int
rpc_rmdir
(
char
*
);
extern
int
rpc_rmdir
(
char
*
);
extern
struct
dentry
*
rpc_mkpipe
(
char
*
,
void
*
,
struct
rpc_pipe_ops
*
,
int
flags
);
extern
struct
dentry
*
rpc_mkpipe
(
char
*
,
void
*
,
struct
rpc_pipe_ops
*
,
int
flags
);
extern
int
rpc_unlink
(
char
*
);
extern
int
rpc_unlink
(
char
*
);
extern
struct
vfsmount
*
rpc_get_mount
(
void
);
extern
void
rpc_put_mount
(
void
);
#endif
#endif
#endif
#endif
net/sunrpc/clnt.c
浏览文件 @
54281548
...
@@ -70,8 +70,15 @@ rpc_setup_pipedir(struct rpc_clnt *clnt, char *dir_name)
...
@@ -70,8 +70,15 @@ rpc_setup_pipedir(struct rpc_clnt *clnt, char *dir_name)
static
uint32_t
clntid
;
static
uint32_t
clntid
;
int
error
;
int
error
;
clnt
->
cl_vfsmnt
=
ERR_PTR
(
-
ENOENT
);
clnt
->
cl_dentry
=
ERR_PTR
(
-
ENOENT
);
if
(
dir_name
==
NULL
)
if
(
dir_name
==
NULL
)
return
0
;
return
0
;
clnt
->
cl_vfsmnt
=
rpc_get_mount
();
if
(
IS_ERR
(
clnt
->
cl_vfsmnt
))
return
PTR_ERR
(
clnt
->
cl_vfsmnt
);
for
(;;)
{
for
(;;)
{
snprintf
(
clnt
->
cl_pathname
,
sizeof
(
clnt
->
cl_pathname
),
snprintf
(
clnt
->
cl_pathname
,
sizeof
(
clnt
->
cl_pathname
),
"%s/clnt%x"
,
dir_name
,
"%s/clnt%x"
,
dir_name
,
...
@@ -84,6 +91,7 @@ rpc_setup_pipedir(struct rpc_clnt *clnt, char *dir_name)
...
@@ -84,6 +91,7 @@ rpc_setup_pipedir(struct rpc_clnt *clnt, char *dir_name)
if
(
error
!=
-
EEXIST
)
{
if
(
error
!=
-
EEXIST
)
{
printk
(
KERN_INFO
"RPC: Couldn't create pipefs entry %s, error %d
\n
"
,
printk
(
KERN_INFO
"RPC: Couldn't create pipefs entry %s, error %d
\n
"
,
clnt
->
cl_pathname
,
error
);
clnt
->
cl_pathname
,
error
);
rpc_put_mount
();
return
error
;
return
error
;
}
}
}
}
...
@@ -175,7 +183,11 @@ rpc_new_client(struct rpc_xprt *xprt, char *servname,
...
@@ -175,7 +183,11 @@ rpc_new_client(struct rpc_xprt *xprt, char *servname,
return
clnt
;
return
clnt
;
out_no_auth:
out_no_auth:
rpc_rmdir
(
clnt
->
cl_pathname
);
if
(
!
IS_ERR
(
clnt
->
cl_dentry
))
{
rpc_rmdir
(
clnt
->
cl_pathname
);
dput
(
clnt
->
cl_dentry
);
rpc_put_mount
();
}
out_no_path:
out_no_path:
if
(
clnt
->
cl_server
!=
clnt
->
cl_inline_name
)
if
(
clnt
->
cl_server
!=
clnt
->
cl_inline_name
)
kfree
(
clnt
->
cl_server
);
kfree
(
clnt
->
cl_server
);
...
@@ -240,13 +252,15 @@ rpc_clone_client(struct rpc_clnt *clnt)
...
@@ -240,13 +252,15 @@ rpc_clone_client(struct rpc_clnt *clnt)
new
->
cl_autobind
=
0
;
new
->
cl_autobind
=
0
;
new
->
cl_oneshot
=
0
;
new
->
cl_oneshot
=
0
;
new
->
cl_dead
=
0
;
new
->
cl_dead
=
0
;
dget
(
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
);
rpc_init_rtt
(
&
new
->
cl_rtt_default
,
clnt
->
cl_xprt
->
timeout
.
to_initval
);
if
(
new
->
cl_auth
)
if
(
new
->
cl_auth
)
atomic_inc
(
&
new
->
cl_auth
->
au_count
);
atomic_inc
(
&
new
->
cl_auth
->
au_count
);
new
->
cl_pmap
=
&
new
->
cl_pmap_default
;
new
->
cl_pmap
=
&
new
->
cl_pmap_default
;
new
->
cl_metrics
=
rpc_alloc_iostats
(
clnt
);
new
->
cl_metrics
=
rpc_alloc_iostats
(
clnt
);
rpc_init_wait_queue
(
&
new
->
cl_pmap_default
.
pm_bindwait
,
"bindwait"
);
return
new
;
return
new
;
out_no_clnt:
out_no_clnt:
printk
(
KERN_INFO
"RPC: out of memory in %s
\n
"
,
__FUNCTION__
);
printk
(
KERN_INFO
"RPC: out of memory in %s
\n
"
,
__FUNCTION__
);
...
@@ -318,8 +332,10 @@ rpc_destroy_client(struct rpc_clnt *clnt)
...
@@ -318,8 +332,10 @@ rpc_destroy_client(struct rpc_clnt *clnt)
out_free:
out_free:
rpc_free_iostats
(
clnt
->
cl_metrics
);
rpc_free_iostats
(
clnt
->
cl_metrics
);
clnt
->
cl_metrics
=
NULL
;
clnt
->
cl_metrics
=
NULL
;
if
(
clnt
->
cl_dentry
)
if
(
!
IS_ERR
(
clnt
->
cl_dentry
))
{
dput
(
clnt
->
cl_dentry
);
dput
(
clnt
->
cl_dentry
);
rpc_put_mount
();
}
kfree
(
clnt
);
kfree
(
clnt
);
return
0
;
return
0
;
}
}
...
...
net/sunrpc/rpc_pipe.c
浏览文件 @
54281548
...
@@ -435,14 +435,17 @@ static struct rpc_filelist authfiles[] = {
...
@@ -435,14 +435,17 @@ static struct rpc_filelist authfiles[] = {
},
},
};
};
static
int
struct
vfsmount
*
rpc_get_mount
(
void
)
rpc_get_mount
(
void
)
{
{
return
simple_pin_fs
(
"rpc_pipefs"
,
&
rpc_mount
,
&
rpc_mount_count
);
int
err
;
err
=
simple_pin_fs
(
"rpc_pipefs"
,
&
rpc_mount
,
&
rpc_mount_count
);
if
(
err
!=
0
)
return
ERR_PTR
(
err
);
return
rpc_mount
;
}
}
static
void
void
rpc_put_mount
(
void
)
rpc_put_mount
(
void
)
{
{
simple_release_fs
(
&
rpc_mount
,
&
rpc_mount_count
);
simple_release_fs
(
&
rpc_mount
,
&
rpc_mount_count
);
}
}
...
@@ -452,12 +455,13 @@ rpc_lookup_parent(char *path, struct nameidata *nd)
...
@@ -452,12 +455,13 @@ rpc_lookup_parent(char *path, struct nameidata *nd)
{
{
if
(
path
[
0
]
==
'\0'
)
if
(
path
[
0
]
==
'\0'
)
return
-
ENOENT
;
return
-
ENOENT
;
if
(
rpc_get_mount
())
{
nd
->
mnt
=
rpc_get_mount
();
if
(
IS_ERR
(
nd
->
mnt
))
{
printk
(
KERN_WARNING
"%s: %s failed to mount "
printk
(
KERN_WARNING
"%s: %s failed to mount "
"pseudofilesystem
\n
"
,
__FILE__
,
__FUNCTION__
);
"pseudofilesystem
\n
"
,
__FILE__
,
__FUNCTION__
);
return
-
ENODEV
;
return
PTR_ERR
(
nd
->
mnt
)
;
}
}
nd
->
mnt
=
mntget
(
rpc_mou
nt
);
mntget
(
nd
->
m
nt
);
nd
->
dentry
=
dget
(
rpc_mount
->
mnt_root
);
nd
->
dentry
=
dget
(
rpc_mount
->
mnt_root
);
nd
->
last_type
=
LAST_ROOT
;
nd
->
last_type
=
LAST_ROOT
;
nd
->
flags
=
LOOKUP_PARENT
;
nd
->
flags
=
LOOKUP_PARENT
;
...
@@ -594,7 +598,6 @@ __rpc_mkdir(struct inode *dir, struct dentry *dentry)
...
@@ -594,7 +598,6 @@ __rpc_mkdir(struct inode *dir, struct dentry *dentry)
d_instantiate
(
dentry
,
inode
);
d_instantiate
(
dentry
,
inode
);
dir
->
i_nlink
++
;
dir
->
i_nlink
++
;
inode_dir_notify
(
dir
,
DN_CREATE
);
inode_dir_notify
(
dir
,
DN_CREATE
);
rpc_get_mount
();
return
0
;
return
0
;
out_err:
out_err:
printk
(
KERN_WARNING
"%s: %s failed to allocate inode for dentry %s
\n
"
,
printk
(
KERN_WARNING
"%s: %s failed to allocate inode for dentry %s
\n
"
,
...
@@ -615,7 +618,6 @@ __rpc_rmdir(struct inode *dir, struct dentry *dentry)
...
@@ -615,7 +618,6 @@ __rpc_rmdir(struct inode *dir, struct dentry *dentry)
if
(
!
error
)
{
if
(
!
error
)
{
inode_dir_notify
(
dir
,
DN_DELETE
);
inode_dir_notify
(
dir
,
DN_DELETE
);
d_drop
(
dentry
);
d_drop
(
dentry
);
rpc_put_mount
();
}
}
return
0
;
return
0
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录