aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/gfs2/glock.c19
-rw-r--r--fs/gfs2/incore.h2
2 files changed, 13 insertions, 8 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 82471c82f024..7175a4d06435 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -334,7 +334,7 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,
334 gl->gl_state = LM_ST_UNLOCKED; 334 gl->gl_state = LM_ST_UNLOCKED;
335 gl->gl_demote_state = LM_ST_EXCLUSIVE; 335 gl->gl_demote_state = LM_ST_EXCLUSIVE;
336 gl->gl_hash = hash; 336 gl->gl_hash = hash;
337 gl->gl_owner_pid = 0; 337 gl->gl_owner_pid = NULL;
338 gl->gl_ip = 0; 338 gl->gl_ip = 0;
339 gl->gl_ops = glops; 339 gl->gl_ops = glops;
340 gl->gl_req_gh = NULL; 340 gl->gl_req_gh = NULL;
@@ -632,7 +632,7 @@ static void gfs2_glmutex_lock(struct gfs2_glock *gl)
632 wait_on_holder(&gh); 632 wait_on_holder(&gh);
633 gfs2_holder_uninit(&gh); 633 gfs2_holder_uninit(&gh);
634 } else { 634 } else {
635 gl->gl_owner_pid = current->pid; 635 gl->gl_owner_pid = get_pid(task_pid(current));
636 gl->gl_ip = (unsigned long)__builtin_return_address(0); 636 gl->gl_ip = (unsigned long)__builtin_return_address(0);
637 spin_unlock(&gl->gl_spin); 637 spin_unlock(&gl->gl_spin);
638 } 638 }
@@ -653,7 +653,7 @@ static int gfs2_glmutex_trylock(struct gfs2_glock *gl)
653 if (test_and_set_bit(GLF_LOCK, &gl->gl_flags)) { 653 if (test_and_set_bit(GLF_LOCK, &gl->gl_flags)) {
654 acquired = 0; 654 acquired = 0;
655 } else { 655 } else {
656 gl->gl_owner_pid = current->pid; 656 gl->gl_owner_pid = get_pid(task_pid(current));
657 gl->gl_ip = (unsigned long)__builtin_return_address(0); 657 gl->gl_ip = (unsigned long)__builtin_return_address(0);
658 } 658 }
659 spin_unlock(&gl->gl_spin); 659 spin_unlock(&gl->gl_spin);
@@ -669,12 +669,17 @@ static int gfs2_glmutex_trylock(struct gfs2_glock *gl)
669 669
670static void gfs2_glmutex_unlock(struct gfs2_glock *gl) 670static void gfs2_glmutex_unlock(struct gfs2_glock *gl)
671{ 671{
672 struct pid *pid;
673
672 spin_lock(&gl->gl_spin); 674 spin_lock(&gl->gl_spin);
673 clear_bit(GLF_LOCK, &gl->gl_flags); 675 clear_bit(GLF_LOCK, &gl->gl_flags);
674 gl->gl_owner_pid = 0; 676 pid = gl->gl_owner_pid;
677 gl->gl_owner_pid = NULL;
675 gl->gl_ip = 0; 678 gl->gl_ip = 0;
676 run_queue(gl); 679 run_queue(gl);
677 spin_unlock(&gl->gl_spin); 680 spin_unlock(&gl->gl_spin);
681
682 put_pid(pid);
678} 683}
679 684
680/** 685/**
@@ -1881,13 +1886,13 @@ static int dump_glock(struct glock_iter *gi, struct gfs2_glock *gl)
1881 print_dbg(gi, " gl_ref = %d\n", atomic_read(&gl->gl_ref)); 1886 print_dbg(gi, " gl_ref = %d\n", atomic_read(&gl->gl_ref));
1882 print_dbg(gi, " gl_state = %u\n", gl->gl_state); 1887 print_dbg(gi, " gl_state = %u\n", gl->gl_state);
1883 if (gl->gl_owner_pid) { 1888 if (gl->gl_owner_pid) {
1884 gl_owner = find_task_by_pid(gl->gl_owner_pid); 1889 gl_owner = pid_task(gl->gl_owner_pid, PIDTYPE_PID);
1885 if (gl_owner) 1890 if (gl_owner)
1886 print_dbg(gi, " gl_owner = pid %d (%s)\n", 1891 print_dbg(gi, " gl_owner = pid %d (%s)\n",
1887 gl->gl_owner_pid, gl_owner->comm); 1892 pid_nr(gl->gl_owner_pid), gl_owner->comm);
1888 else 1893 else
1889 print_dbg(gi, " gl_owner = %d (ended)\n", 1894 print_dbg(gi, " gl_owner = %d (ended)\n",
1890 gl->gl_owner_pid); 1895 pid_nr(gl->gl_owner_pid));
1891 } else 1896 } else
1892 print_dbg(gi, " gl_owner = -1\n"); 1897 print_dbg(gi, " gl_owner = -1\n");
1893 print_dbg(gi, " gl_ip = %lu\n", gl->gl_ip); 1898 print_dbg(gi, " gl_ip = %lu\n", gl->gl_ip);
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index 4b724e772602..525dcae352d6 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -182,7 +182,7 @@ struct gfs2_glock {
182 unsigned int gl_hash; 182 unsigned int gl_hash;
183 unsigned int gl_demote_state; /* state requested by remote node */ 183 unsigned int gl_demote_state; /* state requested by remote node */
184 unsigned long gl_demote_time; /* time of first demote request */ 184 unsigned long gl_demote_time; /* time of first demote request */
185 pid_t gl_owner_pid; 185 struct pid *gl_owner_pid;
186 unsigned long gl_ip; 186 unsigned long gl_ip;
187 struct list_head gl_holders; 187 struct list_head gl_holders;
188 struct list_head gl_waiters1; /* HIF_MUTEX */ 188 struct list_head gl_waiters1; /* HIF_MUTEX */