aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJoseph Qi <joseph.qi@huawei.com>2015-11-05 21:44:13 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-05 22:34:48 -0500
commit5afc44e2e9678c0808211f1662732b368cc25f76 (patch)
treed1df3e1c3be0cf79596ca3c8e67035c9a26974b3 /fs
parentb1529a41f777a48f95d4af29668b70ffe3360e1b (diff)
ocfs2: add uuid to ocfs2 thread name for problem analysis
A node can mount multiple ocfs2 volumes. And if thread names are same for each volume/domain, it will bring inconvenience when analyzing problems because we have to identify which volume/domain the messages belong to. Since thread name will be printed to messages, so add volume uuid or dlm name to thread name can benefit problem analysis. Signed-off-by: Joseph Qi <joseph.qi@huawei.com> Cc: Mark Fasheh <mfasheh@suse.com> Cc: Joel Becker <jlbec@evilplan.org> Cc: Gang He <ghe@suse.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/ocfs2/dlm/dlmdomain.c4
-rw-r--r--fs/ocfs2/dlm/dlmrecovery.c2
-rw-r--r--fs/ocfs2/dlm/dlmthread.c3
-rw-r--r--fs/ocfs2/dlmglue.c3
-rw-r--r--fs/ocfs2/journal.c4
5 files changed, 10 insertions, 6 deletions
diff --git a/fs/ocfs2/dlm/dlmdomain.c b/fs/ocfs2/dlm/dlmdomain.c
index 6918f30d02cd..2ee7fe747cea 100644
--- a/fs/ocfs2/dlm/dlmdomain.c
+++ b/fs/ocfs2/dlm/dlmdomain.c
@@ -1866,6 +1866,7 @@ static int dlm_join_domain(struct dlm_ctxt *dlm)
1866 int status; 1866 int status;
1867 unsigned int backoff; 1867 unsigned int backoff;
1868 unsigned int total_backoff = 0; 1868 unsigned int total_backoff = 0;
1869 char wq_name[O2NM_MAX_NAME_LEN];
1869 1870
1870 BUG_ON(!dlm); 1871 BUG_ON(!dlm);
1871 1872
@@ -1895,7 +1896,8 @@ static int dlm_join_domain(struct dlm_ctxt *dlm)
1895 goto bail; 1896 goto bail;
1896 } 1897 }
1897 1898
1898 dlm->dlm_worker = create_singlethread_workqueue("dlm_wq"); 1899 snprintf(wq_name, O2NM_MAX_NAME_LEN, "dlm_wq-%s", dlm->name);
1900 dlm->dlm_worker = create_singlethread_workqueue(wq_name);
1899 if (!dlm->dlm_worker) { 1901 if (!dlm->dlm_worker) {
1900 status = -ENOMEM; 1902 status = -ENOMEM;
1901 mlog_errno(status); 1903 mlog_errno(status);
diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c
index 58eaa5c0d387..9e4f862d20fe 100644
--- a/fs/ocfs2/dlm/dlmrecovery.c
+++ b/fs/ocfs2/dlm/dlmrecovery.c
@@ -205,7 +205,7 @@ int dlm_launch_recovery_thread(struct dlm_ctxt *dlm)
205 mlog(0, "starting dlm recovery thread...\n"); 205 mlog(0, "starting dlm recovery thread...\n");
206 206
207 dlm->dlm_reco_thread_task = kthread_run(dlm_recovery_thread, dlm, 207 dlm->dlm_reco_thread_task = kthread_run(dlm_recovery_thread, dlm,
208 "dlm_reco_thread"); 208 "dlm_reco-%s", dlm->name);
209 if (IS_ERR(dlm->dlm_reco_thread_task)) { 209 if (IS_ERR(dlm->dlm_reco_thread_task)) {
210 mlog_errno(PTR_ERR(dlm->dlm_reco_thread_task)); 210 mlog_errno(PTR_ERR(dlm->dlm_reco_thread_task));
211 dlm->dlm_reco_thread_task = NULL; 211 dlm->dlm_reco_thread_task = NULL;
diff --git a/fs/ocfs2/dlm/dlmthread.c b/fs/ocfs2/dlm/dlmthread.c
index 2e5e6d5fffe8..c5f6c241ecd7 100644
--- a/fs/ocfs2/dlm/dlmthread.c
+++ b/fs/ocfs2/dlm/dlmthread.c
@@ -493,7 +493,8 @@ int dlm_launch_thread(struct dlm_ctxt *dlm)
493{ 493{
494 mlog(0, "Starting dlm_thread...\n"); 494 mlog(0, "Starting dlm_thread...\n");
495 495
496 dlm->dlm_thread_task = kthread_run(dlm_thread, dlm, "dlm_thread"); 496 dlm->dlm_thread_task = kthread_run(dlm_thread, dlm, "dlm-%s",
497 dlm->name);
497 if (IS_ERR(dlm->dlm_thread_task)) { 498 if (IS_ERR(dlm->dlm_thread_task)) {
498 mlog_errno(PTR_ERR(dlm->dlm_thread_task)); 499 mlog_errno(PTR_ERR(dlm->dlm_thread_task));
499 dlm->dlm_thread_task = NULL; 500 dlm->dlm_thread_task = NULL;
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
index 1c91103c1333..20276e340339 100644
--- a/fs/ocfs2/dlmglue.c
+++ b/fs/ocfs2/dlmglue.c
@@ -2998,7 +2998,8 @@ int ocfs2_dlm_init(struct ocfs2_super *osb)
2998 } 2998 }
2999 2999
3000 /* launch downconvert thread */ 3000 /* launch downconvert thread */
3001 osb->dc_task = kthread_run(ocfs2_downconvert_thread, osb, "ocfs2dc"); 3001 osb->dc_task = kthread_run(ocfs2_downconvert_thread, osb, "ocfs2dc-%s",
3002 osb->uuid_str);
3002 if (IS_ERR(osb->dc_task)) { 3003 if (IS_ERR(osb->dc_task)) {
3003 status = PTR_ERR(osb->dc_task); 3004 status = PTR_ERR(osb->dc_task);
3004 osb->dc_task = NULL; 3005 osb->dc_task = NULL;
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c
index 04d6303f39a7..13534f4fe5b5 100644
--- a/fs/ocfs2/journal.c
+++ b/fs/ocfs2/journal.c
@@ -1090,7 +1090,7 @@ int ocfs2_journal_load(struct ocfs2_journal *journal, int local, int replayed)
1090 /* Launch the commit thread */ 1090 /* Launch the commit thread */
1091 if (!local) { 1091 if (!local) {
1092 osb->commit_task = kthread_run(ocfs2_commit_thread, osb, 1092 osb->commit_task = kthread_run(ocfs2_commit_thread, osb,
1093 "ocfs2cmt"); 1093 "ocfs2cmt-%s", osb->uuid_str);
1094 if (IS_ERR(osb->commit_task)) { 1094 if (IS_ERR(osb->commit_task)) {
1095 status = PTR_ERR(osb->commit_task); 1095 status = PTR_ERR(osb->commit_task);
1096 osb->commit_task = NULL; 1096 osb->commit_task = NULL;
@@ -1507,7 +1507,7 @@ void ocfs2_recovery_thread(struct ocfs2_super *osb, int node_num)
1507 goto out; 1507 goto out;
1508 1508
1509 osb->recovery_thread_task = kthread_run(__ocfs2_recovery_thread, osb, 1509 osb->recovery_thread_task = kthread_run(__ocfs2_recovery_thread, osb,
1510 "ocfs2rec"); 1510 "ocfs2rec-%s", osb->uuid_str);
1511 if (IS_ERR(osb->recovery_thread_task)) { 1511 if (IS_ERR(osb->recovery_thread_task)) {
1512 mlog_errno((int)PTR_ERR(osb->recovery_thread_task)); 1512 mlog_errno((int)PTR_ERR(osb->recovery_thread_task));
1513 osb->recovery_thread_task = NULL; 1513 osb->recovery_thread_task = NULL;