gfs2: Mark the remaining process-independent glock holders as GL_NOPID
authorAndreas Gruenbacher <agruenba@redhat.com>
Tue, 5 Apr 2022 20:39:16 +0000 (22:39 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Wed, 29 Jun 2022 11:07:54 +0000 (13:07 +0200)
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>
fs/gfs2/inode.c
fs/gfs2/ops_fstype.c
fs/gfs2/super.c
fs/gfs2/util.c

index c8ec876f33ea35787d05d2d69c81ca91854ab685..e211ed8636b5b1e525a7b7f2741130ee494aca20 100644 (file)
@@ -143,7 +143,8 @@ struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned int type,
 
                if (blktype != GFS2_BLKST_UNLINKED)
                        gfs2_cancel_delete_work(io_gl);
-               error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED, GL_EXACT,
+               error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED,
+                                          GL_EXACT | GL_NOPID,
                                           &ip->i_iopen_gh);
                gfs2_glock_put(io_gl);
                if (unlikely(error))
@@ -720,7 +721,8 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
        error = insert_inode_locked4(inode, ip->i_no_addr, iget_test, &ip->i_no_addr);
        BUG_ON(error);
 
-       error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED, GL_EXACT, &ip->i_iopen_gh);
+       error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED, GL_EXACT | GL_NOPID,
+                                  &ip->i_iopen_gh);
        if (error)
                goto fail_gunlock2;
 
index c9b423c874a32e64cd0b7439a696e958fa66e709..904a2d47c4b3710e4b9a9b731984371f7a2bfe46 100644 (file)
@@ -403,7 +403,8 @@ static int init_locking(struct gfs2_sbd *sdp, struct gfs2_holder *mount_gh,
 
        error = gfs2_glock_nq_num(sdp,
                                  GFS2_MOUNT_LOCK, &gfs2_nondisk_glops,
-                                 LM_ST_EXCLUSIVE, LM_FLAG_NOEXP | GL_NOCACHE,
+                                 LM_ST_EXCLUSIVE,
+                                 LM_FLAG_NOEXP | GL_NOCACHE | GL_NOPID,
                                  mount_gh);
        if (error) {
                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,
        error = gfs2_glock_nq_num(sdp,
                                  GFS2_LIVE_LOCK, &gfs2_nondisk_glops,
                                  LM_ST_SHARED,
-                                 LM_FLAG_NOEXP | GL_EXACT,
+                                 LM_FLAG_NOEXP | GL_EXACT | GL_NOPID,
                                  &sdp->sd_live_gh);
        if (error) {
                fs_err(sdp, "can't acquire live glock: %d\n", error);
@@ -689,7 +690,7 @@ static int init_statfs(struct gfs2_sbd *sdp)
        iput(pn);
        pn = NULL;
        ip = GFS2_I(sdp->sd_sc_inode);
-       error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0,
+       error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_NOPID,
                                   &sdp->sd_sc_gh);
        if (error) {
                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)
                error = gfs2_glock_nq_num(sdp, sdp->sd_lockstruct.ls_jid,
                                          &gfs2_journal_glops,
                                          LM_ST_EXCLUSIVE,
-                                         LM_FLAG_NOEXP | GL_NOCACHE,
+                                         LM_FLAG_NOEXP | GL_NOCACHE | GL_NOPID,
                                          &sdp->sd_journal_gh);
                if (error) {
                        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)
                ip = GFS2_I(sdp->sd_jdesc->jd_inode);
                sdp->sd_jinode_gl = ip->i_gl;
                error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED,
-                                          LM_FLAG_NOEXP | GL_EXACT | GL_NOCACHE,
+                                          LM_FLAG_NOEXP | GL_EXACT |
+                                          GL_NOCACHE | GL_NOPID,
                                           &sdp->sd_jinode_gh);
                if (error) {
                        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)
        pn = NULL;
 
        ip = GFS2_I(sdp->sd_qc_inode);
-       error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0,
+       error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_NOPID,
                                   &sdp->sd_qc_gh);
        if (error) {
                fs_err(sdp, "can't lock local \"qc\" file: %d\n", error);
index bdb773e5c88f05596f11f4c5ac3c96e868bd6dd5..90db4a2892695a192b383e9b348d588baf1bb21b 100644 (file)
@@ -346,7 +346,8 @@ static int gfs2_lock_fs_check_clean(struct gfs2_sbd *sdp)
        }
 
        error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_EXCLUSIVE,
-                                  LM_FLAG_NOEXP, &sdp->sd_freeze_gh);
+                                  LM_FLAG_NOEXP | GL_NOPID,
+                                  &sdp->sd_freeze_gh);
        if (error)
                goto out;
 
index 8241029a2a5d25a18239171bafa11edfb4982ff4..95d733dd3c25467f9865e00234acbfcee02296a0 100644 (file)
@@ -226,7 +226,8 @@ static void signal_our_withdraw(struct gfs2_sbd *sdp)
         */
        fs_warn(sdp, "Requesting recovery of jid %d.\n",
                sdp->sd_lockstruct.ls_jid);
-       gfs2_holder_reinit(LM_ST_EXCLUSIVE, LM_FLAG_TRY_1CB | LM_FLAG_NOEXP,
+       gfs2_holder_reinit(LM_ST_EXCLUSIVE,
+                          LM_FLAG_TRY_1CB | LM_FLAG_NOEXP | GL_NOPID,
                           &sdp->sd_live_gh);
        msleep(GL_GLOCK_MAX_HOLD);
        /*
@@ -251,7 +252,8 @@ static void signal_our_withdraw(struct gfs2_sbd *sdp)
                        fs_warn(sdp, "Unable to recover our journal jid %d.\n",
                                sdp->sd_lockstruct.ls_jid);
                gfs2_glock_dq_wait(&sdp->sd_live_gh);
-               gfs2_holder_reinit(LM_ST_SHARED, LM_FLAG_NOEXP | GL_EXACT,
+               gfs2_holder_reinit(LM_ST_SHARED,
+                                  LM_FLAG_NOEXP | GL_EXACT | GL_NOPID,
                                   &sdp->sd_live_gh);
                gfs2_glock_nq(&sdp->sd_live_gh);
        }