From: wangdi Date: Mon, 23 Jul 2012 15:19:18 +0000 (-0700) Subject: LU-1662 fid: missing unlock in seq_server_proc_write_width X-Git-Tag: 2.2.92~16 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=9501a58dd776231e93327ad0de91a4a3022ec493 LU-1662 fid: missing unlock in seq_server_proc_write_width cfs_mutex_unlock(&seq->lcs_mutex) is missing in the error handler of seq_server_proc_write_width. Signed-off-by: wang di Change-Id: I7b3c9ebceb40e06362a4f7c0b8e7fe5654c830ec Reviewed-on: http://review.whamcloud.com/3451 Reviewed-by: Andreas Dilger Tested-by: Hudson Reviewed-by: Bobi Jam Tested-by: Maloo --- diff --git a/lustre/fid/lproc_fid.c b/lustre/fid/lproc_fid.c index 7d3d1bb..27fd1f0 100644 --- a/lustre/fid/lproc_fid.c +++ b/lustre/fid/lproc_fid.c @@ -181,20 +181,20 @@ seq_server_proc_write_width(struct file *file, const char *buffer, LASSERT(seq != NULL); - cfs_mutex_lock(&seq->lss_mutex); - - rc = lprocfs_write_helper(buffer, count, &val); - if (rc) - RETURN(rc); + cfs_mutex_lock(&seq->lss_mutex); - seq->lss_width = val; - - if (rc == 0) { - CDEBUG(D_INFO, "%s: Width: "LPU64"\n", - seq->lss_name, seq->lss_width); + rc = lprocfs_write_helper(buffer, count, &val); + if (rc != 0) { + CERROR("%s: invalid width.\n", seq->lss_name); + GOTO(out_unlock, rc); } - cfs_mutex_unlock(&seq->lss_mutex); + seq->lss_width = val; + + CDEBUG(D_INFO, "%s: Width: "LPU64"\n", + seq->lss_name, seq->lss_width); +out_unlock: + cfs_mutex_unlock(&seq->lss_mutex); RETURN(count); }