Skip to content

Commit ebdc416

Browse files
author
Andreas Gruenbacher
committed
gfs2: Mark the remaining process-independent glock holders as GL_NOPID
Add the GL_NOPID flag for the remaining glock holders which are not associated with the current process. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
1 parent b582d5f commit ebdc416

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

fs/gfs2/inode.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned int type,
143143

144144
if (blktype != GFS2_BLKST_UNLINKED)
145145
gfs2_cancel_delete_work(io_gl);
146-
error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED, GL_EXACT,
146+
error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED,
147+
GL_EXACT | GL_NOPID,
147148
&ip->i_iopen_gh);
148149
gfs2_glock_put(io_gl);
149150
if (unlikely(error))
@@ -720,7 +721,8 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
720721
error = insert_inode_locked4(inode, ip->i_no_addr, iget_test, &ip->i_no_addr);
721722
BUG_ON(error);
722723

723-
error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED, GL_EXACT, &ip->i_iopen_gh);
724+
error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED, GL_EXACT | GL_NOPID,
725+
&ip->i_iopen_gh);
724726
if (error)
725727
goto fail_gunlock2;
726728

fs/gfs2/ops_fstype.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,8 @@ static int init_locking(struct gfs2_sbd *sdp, struct gfs2_holder *mount_gh,
403403

404404
error = gfs2_glock_nq_num(sdp,
405405
GFS2_MOUNT_LOCK, &gfs2_nondisk_glops,
406-
LM_ST_EXCLUSIVE, LM_FLAG_NOEXP | GL_NOCACHE,
406+
LM_ST_EXCLUSIVE,
407+
LM_FLAG_NOEXP | GL_NOCACHE | GL_NOPID,
407408
mount_gh);
408409
if (error) {
409410
fs_err(sdp, "can't acquire mount glock: %d\n", error);
@@ -413,7 +414,7 @@ static int init_locking(struct gfs2_sbd *sdp, struct gfs2_holder *mount_gh,
413414
error = gfs2_glock_nq_num(sdp,
414415
GFS2_LIVE_LOCK, &gfs2_nondisk_glops,
415416
LM_ST_SHARED,
416-
LM_FLAG_NOEXP | GL_EXACT,
417+
LM_FLAG_NOEXP | GL_EXACT | GL_NOPID,
417418
&sdp->sd_live_gh);
418419
if (error) {
419420
fs_err(sdp, "can't acquire live glock: %d\n", error);
@@ -689,7 +690,7 @@ static int init_statfs(struct gfs2_sbd *sdp)
689690
iput(pn);
690691
pn = NULL;
691692
ip = GFS2_I(sdp->sd_sc_inode);
692-
error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0,
693+
error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_NOPID,
693694
&sdp->sd_sc_gh);
694695
if (error) {
695696
fs_err(sdp, "can't lock local \"sc\" file: %d\n", error);
@@ -778,7 +779,7 @@ static int init_journal(struct gfs2_sbd *sdp, int undo)
778779
error = gfs2_glock_nq_num(sdp, sdp->sd_lockstruct.ls_jid,
779780
&gfs2_journal_glops,
780781
LM_ST_EXCLUSIVE,
781-
LM_FLAG_NOEXP | GL_NOCACHE,
782+
LM_FLAG_NOEXP | GL_NOCACHE | GL_NOPID,
782783
&sdp->sd_journal_gh);
783784
if (error) {
784785
fs_err(sdp, "can't acquire journal glock: %d\n", error);
@@ -788,7 +789,8 @@ static int init_journal(struct gfs2_sbd *sdp, int undo)
788789
ip = GFS2_I(sdp->sd_jdesc->jd_inode);
789790
sdp->sd_jinode_gl = ip->i_gl;
790791
error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED,
791-
LM_FLAG_NOEXP | GL_EXACT | GL_NOCACHE,
792+
LM_FLAG_NOEXP | GL_EXACT |
793+
GL_NOCACHE | GL_NOPID,
792794
&sdp->sd_jinode_gh);
793795
if (error) {
794796
fs_err(sdp, "can't acquire journal inode glock: %d\n",
@@ -959,7 +961,7 @@ static int init_per_node(struct gfs2_sbd *sdp, int undo)
959961
pn = NULL;
960962

961963
ip = GFS2_I(sdp->sd_qc_inode);
962-
error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0,
964+
error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_NOPID,
963965
&sdp->sd_qc_gh);
964966
if (error) {
965967
fs_err(sdp, "can't lock local \"qc\" file: %d\n", error);

fs/gfs2/super.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,8 @@ static int gfs2_lock_fs_check_clean(struct gfs2_sbd *sdp)
346346
}
347347

348348
error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_EXCLUSIVE,
349-
LM_FLAG_NOEXP, &sdp->sd_freeze_gh);
349+
LM_FLAG_NOEXP | GL_NOPID,
350+
&sdp->sd_freeze_gh);
350351
if (error)
351352
goto out;
352353

fs/gfs2/util.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ static void signal_our_withdraw(struct gfs2_sbd *sdp)
226226
*/
227227
fs_warn(sdp, "Requesting recovery of jid %d.\n",
228228
sdp->sd_lockstruct.ls_jid);
229-
gfs2_holder_reinit(LM_ST_EXCLUSIVE, LM_FLAG_TRY_1CB | LM_FLAG_NOEXP,
229+
gfs2_holder_reinit(LM_ST_EXCLUSIVE,
230+
LM_FLAG_TRY_1CB | LM_FLAG_NOEXP | GL_NOPID,
230231
&sdp->sd_live_gh);
231232
msleep(GL_GLOCK_MAX_HOLD);
232233
/*
@@ -251,7 +252,8 @@ static void signal_our_withdraw(struct gfs2_sbd *sdp)
251252
fs_warn(sdp, "Unable to recover our journal jid %d.\n",
252253
sdp->sd_lockstruct.ls_jid);
253254
gfs2_glock_dq_wait(&sdp->sd_live_gh);
254-
gfs2_holder_reinit(LM_ST_SHARED, LM_FLAG_NOEXP | GL_EXACT,
255+
gfs2_holder_reinit(LM_ST_SHARED,
256+
LM_FLAG_NOEXP | GL_EXACT | GL_NOPID,
255257
&sdp->sd_live_gh);
256258
gfs2_glock_nq(&sdp->sd_live_gh);
257259
}

0 commit comments

Comments
 (0)