diff options
author | Peng Tao <bergwolf@gmail.com> | 2013-05-29 21:40:56 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-05-30 20:49:45 +0900 |
commit | 1e4db2b325bc0fa6517ae6081b9284a207b9a688 (patch) | |
tree | 515307c308d08c320f585893fce38be93497e5fd | |
parent | 73bb1da692d0dc3e93b9c9e29084d6a5dcbc37a6 (diff) | |
download | linux-stable-1e4db2b325bc0fa6517ae6081b9284a207b9a688.tar.gz linux-stable-1e4db2b325bc0fa6517ae6081b9284a207b9a688.tar.bz2 linux-stable-1e4db2b325bc0fa6517ae6081b9284a207b9a688.zip |
staging/lustre: fix LBUG and inode refcount bug
ldlm_proc_setup and ldlm_proc_cleanup should reset global
pde pointers otherwise remount may hit
LASSERT(ldlm_ns_proc_dir == NULL);
Also in libcfs_sock_ioctl, fput() includes itself sock_release.
So don't call sock_release twice otherwise kernel may oops
due to incorrect inode ref counting.
Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 6 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c | 9 |
2 files changed, 8 insertions, 7 deletions
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c index f4d5b50b46ae..9052dc5e7ad2 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c @@ -130,6 +130,8 @@ err_type: lprocfs_remove(&ldlm_type_proc_dir); err: ldlm_svc_proc_dir = NULL; + ldlm_type_proc_dir = NULL; + ldlm_ns_proc_dir = NULL; RETURN(rc); } @@ -143,6 +145,10 @@ void ldlm_proc_cleanup(void) if (ldlm_type_proc_dir) lprocfs_remove(&ldlm_type_proc_dir); + + ldlm_svc_proc_dir = NULL; + ldlm_type_proc_dir = NULL; + ldlm_ns_proc_dir = NULL; } static int lprocfs_ns_resources_seq_show(struct seq_file *m, void *v) diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c index 4a018167cb03..6f1f047d6555 100644 --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c @@ -49,7 +49,6 @@ libcfs_sock_ioctl(int cmd, unsigned long arg) { mm_segment_t oldmm = get_fs(); struct socket *sock; - int fd = -1; int rc; struct file *sock_filp; @@ -61,6 +60,7 @@ libcfs_sock_ioctl(int cmd, unsigned long arg) sock_filp = sock_alloc_file(sock, 0, NULL); if (!sock_filp) { + sock_release(sock); rc = -ENOMEM; goto out; } @@ -71,12 +71,7 @@ libcfs_sock_ioctl(int cmd, unsigned long arg) set_fs(oldmm); fput(sock_filp); - - out: - if (fd >= 0) - sys_close(fd); - else - sock_release(sock); +out: return rc; } |