Skip to content

Commit 47b7ec1

Browse files
andypriceAndreas Gruenbacher
authored andcommitted
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. Signed-off-by: Andrew Price <anprice@redhat.com> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
1 parent 78178ca commit 47b7ec1

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

fs/gfs2/incore.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,7 @@ struct gfs2_args {
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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ static int gfs2_check_sb(struct gfs2_sbd *sdp, int silent)
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 @@ static int gfs2_lm_mount(struct gfs2_sbd *sdp, int silent)
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)
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)
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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
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)

0 commit comments

Comments
 (0)