From d2919e370b63caf098ef9f3f097adbde5b32fa99 Mon Sep 17 00:00:00 2001 From: adilger Date: Fri, 4 Jul 2008 23:22:15 +0000 Subject: [PATCH] Branch b1_6 Remove spurious LPROCFS_EXIT() from lprocfs_evict_client_release(), which is breaking the reference count on the semaphore. b=16288 i=adilger (wangdi original patch) --- lustre/obdclass/lprocfs_status.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index 3961596..c80e811 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); @@ -1506,7 +1507,7 @@ int lprocfs_write_frac_u64_helper(const char *buffer, unsigned long count, __u64 whole, frac = 0, units; unsigned frac_d = 1; - if (count > (sizeof(kernbuf) - 1) ) + if (count > (sizeof(kernbuf) - 1)) return -EINVAL; if (copy_from_user(kernbuf, buffer, count)) -- 1.8.3.1