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
586 unsigned int ar_errors:2; /* errors=withdraw | panic */586 unsigned int ar_errors:2; /* errors=withdraw | panic */
587 unsigned int ar_nobarrier:1; /* do not send barriers */587 unsigned int ar_nobarrier:1; /* do not send barriers */
588 unsigned int ar_rgrplvb:1; /* use lvbs for rgrp info */588 unsigned int ar_rgrplvb:1; /* use lvbs for rgrp info */
589 unsigned int ar_got_rgrplvb:1; /* Was the rgrplvb opt given? */
589 unsigned int ar_loccookie:1; /* use location based readdir590 unsigned int ar_loccookie:1; /* use location based readdir
590 cookies */591 cookies */
591 s32 ar_commit; /* Commit interval */592 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
171 return -EINVAL;171 return -EINVAL;
172 }172 }
173 173
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 ||
175 sb->sb_multihost_format != GFS2_FORMAT_MULTI) {176 sb->sb_multihost_format != GFS2_FORMAT_MULTI) {
176 fs_warn(sdp, "Unknown on-disk format, unable to mount\n");177 fs_warn(sdp, "Unknown on-disk format, unable to mount\n");
177 return -EINVAL;178 return -EINVAL;
@@ -1032,13 +1033,14 @@ hostdata_error: · 854 unmodified lines
1032 }1033 }
1033 1034
1034 if (lm->lm_mount == NULL) {1035 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);
1036 complete_all(&sdp->sd_locking_init);1037 complete_all(&sdp->sd_locking_init);
1037 return 0;1038 return 0;
1038 }1039 }
1039 ret = lm->lm_mount(sdp, table);1040 ret = lm->lm_mount(sdp, table);
1040 if (ret == 0)1041 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);
1042 complete_all(&sdp->sd_locking_init);1044 complete_all(&sdp->sd_locking_init);
1043 return ret;1045 return ret;
1044}1046}
@@ -1157,6 +1159,10 @@ static int gfs2_fill_super(struct super_block *sb, struct fs_context *fc) · 112 unmodified lines
1157 if (error)1159 if (error)
1158 goto fail_locking;1160 goto fail_locking;
1159 1161
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
1160 error = wait_on_journal(sdp);1166 error = wait_on_journal(sdp);
1161 if (error)1167 if (error)
1162 goto fail_sb;1168 goto fail_sb;
@@ -1450,6 +1456,7 @@ static int gfs2_parse_param(struct fs_context *fc, struct fs_parameter *param) · 287 unmodified lines
1450 break;1456 break;
1451 case Opt_rgrplvb:1457 case Opt_rgrplvb:
1452 args->ar_rgrplvb = result.boolean;1458 args->ar_rgrplvb = result.boolean;
1459 args->ar_got_rgrplvb = 1;
1453 break;1460 break;
1454 case Opt_loccookie:1461 case Opt_loccookie:
1455 args->ar_loccookie = result.boolean;1462 args->ar_loccookie = result.boolean;
fs/gfs2/super.h+4−0
@@ -11,6 +11,10 @@ · 10 unmodified lines
11#include <linux/dcache.h>11#include <linux/dcache.h>
12#include "incore.h"12#include "incore.h"
13 13
14/* Supported fs format version range */
15#define GFS2_FS_FORMAT_MIN (1801)
16#define GFS2_FS_FORMAT_MAX (1802)
17
14extern void gfs2_lm_unmount(struct gfs2_sbd *sdp);18extern void gfs2_lm_unmount(struct gfs2_sbd *sdp);
15 19
16static inline unsigned int gfs2_jindex_size(struct gfs2_sbd *sdp)20static inline unsigned int gfs2_jindex_size(struct gfs2_sbd *sdp)