History

gfs2: Enable rgrplvb for sb_fs_format 1802

Turn on rgrplvb by default for sb_fs_format > 1801. Mount options still have to override this so a new args field to differentiate between 'off' and 'not specified' is added, and the new default is applied only when it's not specified.

Andrew Price committed 5 years ago

Commit 47b7ec11 parent 78178ca3 files · +15 −3Browse files

Unified · Split

3 files
  1. fs/gfs2/incore.h +1 −0
  2. fs/gfs2/ops_fstype.c +10 −3
  3. fs/gfs2/super.h +4 −0
fs/gfs2/incore.h+1−0
@@ -586,6 +586,7 @@ struct gfs2_args { · 585 unmodified lines
586586 unsigned int ar_errors:2; /* errors=withdraw | panic */
587587 unsigned int ar_nobarrier:1; /* do not send barriers */
588588 unsigned int ar_rgrplvb:1; /* use lvbs for rgrp info */
589+ unsigned int ar_got_rgrplvb:1; /* Was the rgrplvb opt given? */
589590 unsigned int ar_loccookie:1; /* use location based readdir
590591 cookies */
591592 s32 ar_commit; /* Commit interval */
fs/gfs2/ops_fstype.c+10−3
@@ -171,7 +171,8 @@ static int gfs2_check_sb(struct gfs2_sbd *sdp, int silent) · 170 unmodified lines
171171 return -EINVAL;
172172 }
173173
174− if (sb->sb_fs_format != GFS2_FORMAT_FS ||
174+ if (sb->sb_fs_format < GFS2_FS_FORMAT_MIN ||
175+ sb->sb_fs_format > GFS2_FS_FORMAT_MAX ||
175176 sb->sb_multihost_format != GFS2_FORMAT_MULTI) {
176177 fs_warn(sdp, "Unknown on-disk format, unable to mount\n");
177178 return -EINVAL;
@@ -1032,13 +1033,14 @@ hostdata_error: · 854 unmodified lines
10321033 }
10331034
10341035 if (lm->lm_mount == NULL) {
1035− fs_info(sdp, "Now mounting FS...\n");
1036+ fs_info(sdp, "Now mounting FS (format %u)...\n", sdp->sd_sb.sb_fs_format);
10361037 complete_all(&sdp->sd_locking_init);
10371038 return 0;
10381039 }
10391040 ret = lm->lm_mount(sdp, table);
10401041 if (ret == 0)
1041− fs_info(sdp, "Joined cluster. Now mounting FS...\n");
1042+ fs_info(sdp, "Joined cluster. Now mounting FS (format %u)...\n",
1043+ sdp->sd_sb.sb_fs_format);
10421044 complete_all(&sdp->sd_locking_init);
10431045 return ret;
10441046 }
@@ -1157,6 +1159,10 @@ static int gfs2_fill_super(struct super_block *sb, struct fs_context *fc) · 112 unmodified lines
11571159 if (error)
11581160 goto fail_locking;
11591161
1162+ /* Turn rgrplvb on by default if fs format is recent enough */
1163+ if (!sdp->sd_args.ar_got_rgrplvb && sdp->sd_sb.sb_fs_format > 1801)
1164+ sdp->sd_args.ar_rgrplvb = 1;
1165+
11601166 error = wait_on_journal(sdp);
11611167 if (error)
11621168 goto fail_sb;
@@ -1450,6 +1456,7 @@ static int gfs2_parse_param(struct fs_context *fc, struct fs_parameter *param) · 287 unmodified lines
14501456 break;
14511457 case Opt_rgrplvb:
14521458 args->ar_rgrplvb = result.boolean;
1459+ args->ar_got_rgrplvb = 1;
14531460 break;
14541461 case Opt_loccookie:
14551462 args->ar_loccookie = result.boolean;
fs/gfs2/super.h+4−0
@@ -11,6 +11,10 @@ · 10 unmodified lines
1111 #include <linux/dcache.h>
1212 #include "incore.h"
1313
14+/* Supported fs format version range */
15+#define GFS2_FS_FORMAT_MIN (1801)
16+#define GFS2_FS_FORMAT_MAX (1802)
17+
1418 extern void gfs2_lm_unmount(struct gfs2_sbd *sdp);
1519
1620 static inline unsigned int gfs2_jindex_size(struct gfs2_sbd *sdp)