From: Jeff Mahoney Date: Mon, 4 Feb 2013 22:05:02 +0000 (-0500) Subject: LU-2729 mgs: fix cleanup of nonexistant MGSSELF_NAME proc file X-Git-Tag: 2.3.62~34 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=8421d161cc0f76ca4d635b8f9e6ebb1b5e7b9b47;p=fs%2Flustre-release.git LU-2729 mgs: fix cleanup of nonexistant MGSSELF_NAME proc file The mgs teardown code gets invoked in the failure case but assumes that the MGSSELF_NAME proc file has been created. If it hasn't been created, the proc code issues a WARN_ON. The setup code clears the FSDB_MGS_SELF from &fsdb->fsdb_flags when it creates the proc file, so we can key off of that to decide whether to remove it. Signed-off-by: Jeff Mahoney Change-Id: Idf58d1fa572eeced5dbaa72f03e38ee46a708166 Reviewed-on: http://review.whamcloud.com/5122 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Niu Yawei Reviewed-by: James Simmons Reviewed-by: Andreas Dilger --- diff --git a/lustre/mgs/lproc_mgs.c b/lustre/mgs/lproc_mgs.c index 54f299b..65513fd 100644 --- a/lustre/mgs/lproc_mgs.c +++ b/lustre/mgs/lproc_mgs.c @@ -292,7 +292,9 @@ int lproc_mgs_del_live(struct mgs_device *mgs, struct fs_db *fsdb) if (!mgs->mgs_proc_live) return 0; - lprocfs_remove_proc_entry(fsdb->fsdb_name, mgs->mgs_proc_live); + /* didn't create the proc file for MGSSELF_NAME */ + if (!test_bit(FSDB_MGS_SELF, &fsdb->fsdb_flags)) + lprocfs_remove_proc_entry(fsdb->fsdb_name, mgs->mgs_proc_live); return 0; }