From ed1db6f74f5b726e43272320665149cf38e56aa1 Mon Sep 17 00:00:00 2001 From: adilger Date: Fri, 4 Jul 2008 23:34:36 +0000 Subject: [PATCH] Branch b1_8 Remove spurious LPROCFS_EXIT() that is breaking the semaphore refcount. b=16288 i=adilger (wangdi original patch) --- lustre/obdclass/lprocfs_status.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index 3961596..4e9b212 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -204,7 +204,6 @@ int lprocfs_evict_client_release(struct inode *inode, struct file *f) atomic_dec(&obd->obd_evict_inprogress); wake_up(&obd->obd_evict_inprogress_waitq); - LPROCFS_EXIT(); return 0; } @@ -360,11 +359,13 @@ int lprocfs_wr_uint(struct file *file, const char *buffer, unsigned long count, void *data) { unsigned *p = data; - char dummy[MAX_STRING_SIZE + 1], *end; + char dummy[MAX_STRING_SIZE + 1] = { '\0' }, *end; unsigned long tmp; - dummy[MAX_STRING_SIZE] = '\0'; - if (copy_from_user(dummy, buffer, MAX_STRING_SIZE)) + if (count >= sizeof(dummy) || count == 0) + return -EINVAL; + + if (copy_from_user(dummy, buffer, count)) return -EFAULT; tmp = simple_strtoul(dummy, &end, 0); -- 1.8.3.1