Whamcloud - gitweb
LU-8900 snapshot: new config for MDT write barrier
[fs/lustre-release.git] / lustre / mgs / lproc_mgs.c
index c797112..4be26c5 100644 (file)
@@ -178,15 +178,22 @@ LPROC_SEQ_FOPS(mgs_live);
 
 int lproc_mgs_add_live(struct mgs_device *mgs, struct fs_db *fsdb)
 {
-       if (!mgs->mgs_proc_live)
+       int rc;
+
+       if (!mgs->mgs_proc_live || fsdb->fsdb_has_lproc_entry)
                return 0;
-       return lprocfs_seq_create(mgs->mgs_proc_live, fsdb->fsdb_name, 0644,
-                                 &mgs_live_fops, fsdb);
+
+       rc = lprocfs_seq_create(mgs->mgs_proc_live, fsdb->fsdb_name, 0644,
+                               &mgs_live_fops, fsdb);
+       if (!rc)
+               fsdb->fsdb_has_lproc_entry = 1;
+
+       return rc;
 }
 
 int lproc_mgs_del_live(struct mgs_device *mgs, struct fs_db *fsdb)
 {
-       if (!mgs->mgs_proc_live)
+       if (!mgs->mgs_proc_live || !fsdb->fsdb_has_lproc_entry)
                return 0;
 
        /* didn't create the proc file for MGSSELF_NAME */