.. | .. |
---|
145 | 145 | return -EIO; |
---|
146 | 146 | |
---|
147 | 147 | error = gfs2_find_jhead(sdp->sd_jdesc, &head, false); |
---|
148 | | - if (error || gfs2_withdrawn(sdp)) |
---|
| 148 | + if (error) { |
---|
| 149 | + gfs2_consist(sdp); |
---|
149 | 150 | return error; |
---|
| 151 | + } |
---|
150 | 152 | |
---|
151 | 153 | if (!(head.lh_flags & GFS2_LOG_HEAD_UNMOUNT)) { |
---|
152 | 154 | gfs2_consist(sdp); |
---|
.. | .. |
---|
158 | 160 | gfs2_log_pointers_init(sdp, head.lh_blkno); |
---|
159 | 161 | |
---|
160 | 162 | error = gfs2_quota_init(sdp); |
---|
161 | | - if (!error && !gfs2_withdrawn(sdp)) |
---|
| 163 | + if (!error && gfs2_withdrawn(sdp)) |
---|
| 164 | + error = -EIO; |
---|
| 165 | + if (!error) |
---|
162 | 166 | set_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags); |
---|
163 | 167 | return error; |
---|
164 | 168 | } |
---|
.. | .. |
---|
1013 | 1017 | { |
---|
1014 | 1018 | struct gfs2_sbd *sdp = root->d_sb->s_fs_info; |
---|
1015 | 1019 | 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); |
---|
1017 | 1028 | |
---|
1018 | 1029 | if (is_ancestor(root, sdp->sd_master_dir)) |
---|
1019 | 1030 | seq_puts(s, ",meta"); |
---|
.. | .. |
---|
1068 | 1079 | } |
---|
1069 | 1080 | if (args->ar_discard) |
---|
1070 | 1081 | 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) |
---|
1078 | 1087 | 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); |
---|
1082 | 1090 | if (args->ar_statfs_percent) |
---|
1083 | 1091 | seq_printf(s, ",statfs_percent=%d", args->ar_statfs_percent); |
---|
1084 | 1092 | if (args->ar_errors != GFS2_ERRORS_DEFAULT) { |
---|
.. | .. |
---|
1412 | 1420 | if (inode->i_nlink || sb_rdonly(sb)) |
---|
1413 | 1421 | goto out; |
---|
1414 | 1422 | |
---|
| 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 | + |
---|
1415 | 1431 | gfs2_holder_mark_uninitialized(&gh); |
---|
1416 | 1432 | ret = evict_should_delete(inode, &gh); |
---|
1417 | 1433 | if (ret == SHOULD_DEFER_EVICTION) |
---|