hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/fs/gfs2/super.c
....@@ -145,8 +145,10 @@
145145 return -EIO;
146146
147147 error = gfs2_find_jhead(sdp->sd_jdesc, &head, false);
148
- if (error || gfs2_withdrawn(sdp))
148
+ if (error) {
149
+ gfs2_consist(sdp);
149150 return error;
151
+ }
150152
151153 if (!(head.lh_flags & GFS2_LOG_HEAD_UNMOUNT)) {
152154 gfs2_consist(sdp);
....@@ -158,7 +160,9 @@
158160 gfs2_log_pointers_init(sdp, head.lh_blkno);
159161
160162 error = gfs2_quota_init(sdp);
161
- if (!error && !gfs2_withdrawn(sdp))
163
+ if (!error && gfs2_withdrawn(sdp))
164
+ error = -EIO;
165
+ if (!error)
162166 set_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags);
163167 return error;
164168 }
....@@ -1013,7 +1017,14 @@
10131017 {
10141018 struct gfs2_sbd *sdp = root->d_sb->s_fs_info;
10151019 struct gfs2_args *args = &sdp->sd_args;
1016
- int val;
1020
+ unsigned int logd_secs, statfs_slow, statfs_quantum, quota_quantum;
1021
+
1022
+ spin_lock(&sdp->sd_tune.gt_spin);
1023
+ logd_secs = sdp->sd_tune.gt_logd_secs;
1024
+ quota_quantum = sdp->sd_tune.gt_quota_quantum;
1025
+ statfs_quantum = sdp->sd_tune.gt_statfs_quantum;
1026
+ statfs_slow = sdp->sd_tune.gt_statfs_slow;
1027
+ spin_unlock(&sdp->sd_tune.gt_spin);
10171028
10181029 if (is_ancestor(root, sdp->sd_master_dir))
10191030 seq_puts(s, ",meta");
....@@ -1068,17 +1079,14 @@
10681079 }
10691080 if (args->ar_discard)
10701081 seq_puts(s, ",discard");
1071
- val = sdp->sd_tune.gt_logd_secs;
1072
- if (val != 30)
1073
- seq_printf(s, ",commit=%d", val);
1074
- val = sdp->sd_tune.gt_statfs_quantum;
1075
- if (val != 30)
1076
- seq_printf(s, ",statfs_quantum=%d", val);
1077
- else if (sdp->sd_tune.gt_statfs_slow)
1082
+ if (logd_secs != 30)
1083
+ seq_printf(s, ",commit=%d", logd_secs);
1084
+ if (statfs_quantum != 30)
1085
+ seq_printf(s, ",statfs_quantum=%d", statfs_quantum);
1086
+ else if (statfs_slow)
10781087 seq_puts(s, ",statfs_quantum=0");
1079
- val = sdp->sd_tune.gt_quota_quantum;
1080
- if (val != 60)
1081
- seq_printf(s, ",quota_quantum=%d", val);
1088
+ if (quota_quantum != 60)
1089
+ seq_printf(s, ",quota_quantum=%d", quota_quantum);
10821090 if (args->ar_statfs_percent)
10831091 seq_printf(s, ",statfs_percent=%d", args->ar_statfs_percent);
10841092 if (args->ar_errors != GFS2_ERRORS_DEFAULT) {
....@@ -1412,6 +1420,14 @@
14121420 if (inode->i_nlink || sb_rdonly(sb))
14131421 goto out;
14141422
1423
+ /*
1424
+ * In case of an incomplete mount, gfs2_evict_inode() may be called for
1425
+ * system files without having an active journal to write to. In that
1426
+ * case, skip the filesystem evict.
1427
+ */
1428
+ if (!sdp->sd_jdesc)
1429
+ goto out;
1430
+
14151431 gfs2_holder_mark_uninitialized(&gh);
14161432 ret = evict_should_delete(inode, &gh);
14171433 if (ret == SHOULD_DEFER_EVICTION)