gfs2: Mark journal inodes as "don't cache"
authorBob Peterson <rpeterso@redhat.com>
Fri, 30 Jul 2021 17:40:25 +0000 (12:40 -0500)
committerBob Peterson <rpeterso@redhat.com>
Fri, 20 Aug 2021 14:03:46 +0000 (09:03 -0500)
Before this patch, journal inodes were considered regular inodes,
which meant that instead of evicting them, function iput_final would
just put them on the lru for later processing. If the file system
withdrew for whatever reason, the withdraw would never be seen until
the inode was evicted, which could be indefinitely.

This patch marks all journal inodes as "don't cache" which means
function iput_final will evict them immediately, allowing us to
properly recover the journal on other cluster nodes.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
fs/gfs2/ops_fstype.c
fs/gfs2/util.c

index 5b90d2b7db4702796afec46a7b51f5c253b0901a..7f8410d8fdc1d7e7a7ecefe604cebf12da32bde8 100644 (file)
@@ -614,6 +614,7 @@ static int gfs2_jindex_hold(struct gfs2_sbd *sdp, struct gfs2_holder *ji_gh)
                        break;
                }
 
+               d_mark_dontcache(jd->jd_inode);
                spin_lock(&sdp->sd_jindex_spin);
                jd->jd_jid = sdp->sd_journals++;
                jip = GFS2_I(jd->jd_inode);
index 34087bba88ee5284f39af5a185880f17b23c0643..cf345a86ef67b6d955f8648282e3bbe7d1c0e360 100644 (file)
@@ -278,6 +278,7 @@ static void signal_our_withdraw(struct gfs2_sbd *sdp)
                goto skip_recovery;
        }
        sdp->sd_jdesc->jd_inode = inode;
+       d_mark_dontcache(inode);
 
        /*
         * Now wait until recovery is complete.