]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfsprogs update - Andi's mkfs log size default change and enabling large v2.5.0
authorNathan Scott <nathans@sgi.com>
Wed, 18 Jun 2003 06:04:16 +0000 (06:04 +0000)
committerNathan Scott <nathans@sgi.com>
Wed, 18 Jun 2003 06:04:16 +0000 (06:04 +0000)
sector support being the two big ticket items, several other small fixes
too.
bump to 2.5.0 for default mkfs changes and optional large sector support.

21 files changed:
VERSION
debian/changelog
doc/CHANGES
doc/CREDITS
include/platform_defs.h.in
include/xfs_inode.h
include/xfs_mount.h
include/xfs_sb.h
include/xfs_types.h
io/open.c
io/pread.c
io/prealloc.c
io/pwrite.c
io/resblks.c
io/truncate.c
libdisk/md.c
libxfs/rdwr.c
libxfs/xfs_inode.c
man/man8/mkfs.xfs.8
mkfs/xfs_mkfs.c
repair/sb.c

diff --git a/VERSION b/VERSION
index eca795626f666b3bc3b50f0232ae14b181d3e37f..8dff1c94b0a7d32b2b86c19e55138451c0f4293a 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,6 +2,6 @@
 # This file is used by configure to get version information
 #
 PKG_MAJOR=2
-PKG_MINOR=4
-PKG_REVISION=12
+PKG_MINOR=5
+PKG_REVISION=0
 PKG_BUILD=0
index 56e79fd5285ab3b7bb8820b294a0b5f63def1e0b..9c1bc8479084fd874c329f0cdc1b8d705082dddb 100644 (file)
@@ -1,3 +1,12 @@
+xfsprogs (2.5.0-1) unstable; urgency=low
+
+  * New upstream release
+  * Changed mkfs.xfs default log size scaling algorithm slightly, to
+    create larger logs at smaller filesystem sizes by default
+  * Enable support for sector sizes larger than 512 bytes
+
+ -- Nathan Scott <nathans@debian.org>  Wed, 18 Jun 2003 12:56:16 +1000
+
 xfsprogs (2.4.12-1) unstable; urgency=low
 
   * New upstream release
index f74be89bd35bb8f88568d8f66dcacf6a845fedfb..e93d5fded87fd6b2209896793fb73c965270f605 100644 (file)
@@ -1,3 +1,15 @@
+xfsprogs-2.5.0 (18 June 2003)
+       - Fix libdisk (and hence mkfs) code which warns on MD devices
+         with the clean flag not set, apparently this is not so wise.
+       - Fix libxfs_device_zero to work with smaller-than-requested
+         write return values.
+       - Fix error in xfs_io pwrite code with large request sizes.
+       - Fix rounding-down-input problems in several xfs_io commands.
+       - Changed mkfs.xfs default log size scaling algorithm slightly,
+         to create larger logs at smaller filesystem sizes by default
+         (thanks to Andi Kleen for the patch).
+       - Enable support for sector sizes larger than 512 bytes.
+
 xfsprogs-2.4.12 (02 June 2003)
        - Fix xfs_logprint handling of any version 2 log device.
        - Remove calls to exit in libhandle, propogate errors to
index c7ac9bedbe63ec12163b401fce684cf05b2fe924..6e86b54b80fe8397be96ec6afea42fd997bb549e 100644 (file)
@@ -46,6 +46,13 @@ S: Krosenska' 543
 S: 181 00 Praha 8
 S: Czech Republic
 
+N: Andi Kleen
+E: ak@muc.de
+D: Most recently, fine-tuning default mkfs/mount logsize/logbufs values
+S: Schwalbenstr. 96
+S: 85551 Ottobrunn
+S: Germany
+
 N: Seth Mos
 E: seth@arosa.nl
 D: XFS FAQ ( http://oss.sgi.com/projects/xfs/faq.html ) maintainer
index 5dff46cd4a15ee3a7817ee9e0eeb4f228ac5e3f2..1b3915cb49cfc1d76b19ac35dfeb338c77cc6453 100644 (file)
@@ -113,8 +113,8 @@ typedef unsigned char       uchar_t;
 #endif
 
 #ifndef _BOOLEAN_T_DEFINED
- typedef enum { B_FALSE, B_TRUE } boolean_t;
- #define _BOOLEAN_T_DEFINED 1
+typedef enum {B_FALSE, B_TRUE} boolean_t;
+#define _BOOLEAN_T_DEFINED     1
 #endif
 
 #elif defined(__FreeBSD__)
index 1983c3e6402804668a30cb9c5397bd6605ff654b..16cbcfe8174d3ab95887a2ca4301c130f30d50bf 100644 (file)
@@ -364,6 +364,7 @@ void xfs_ifork_next_set(xfs_inode_t *ip, int w, int n);
 #define XFS_IUIOSZ     0x0002  /* inode i/o sizes have been explicitly set */
 #define XFS_IQUIESCE    0x0004  /* we have started quiescing for this inode */
 #define XFS_IRECLAIM    0x0008  /* we have started reclaiming this inode    */
+#define XFS_IRECLAIMABLE 0x0010 /* inode can be reclaimed */
 
 /*
  * Flags for inode locking.
index 27c5df0b70b81be18b2afccdf5324658afeed866..829fd0fa5cc783c4f295a129b794b00b12033766 100644 (file)
@@ -539,7 +539,7 @@ typedef struct xfs_mod_sb {
 extern xfs_mount_t *xfs_mount_init(void);
 extern void    xfs_mod_sb(xfs_trans_t *, __int64_t);
 extern void    xfs_mount_free(xfs_mount_t *mp, int remove_bhv);
-extern int     xfs_mountfs(struct vfs *, xfs_mount_t *mp, dev_t, int);
+extern int     xfs_mountfs(struct vfs *, xfs_mount_t *mp, int);
 
 extern int     xfs_unmountfs(xfs_mount_t *, struct cred *);
 extern void    xfs_unmountfs_close(xfs_mount_t *, struct cred *);
index f0dea2a848fb783821f3a3e7426b51e07cdfa2e3..9a8bc968cc088ab4af6839c9a02cde6d71e81416 100644 (file)
@@ -81,7 +81,7 @@ struct xfs_mount;
         XFS_SB_VERSION_OKREALFBITS | \
         XFS_SB_VERSION_OKSASHFBITS)
 #define XFS_SB_VERSION_MKFS(ia,dia,extflag,dirv2,na,sflag)     \
-       (((ia) || (dia) || (extflag) || (dirv2) || (na)) ? \
+       (((ia) || (dia) || (extflag) || (dirv2) || (na) || (sflag)) ? \
                (XFS_SB_VERSION_4 | \
                 ((ia) ? XFS_SB_VERSION_ALIGNBIT : 0) | \
                 ((dia) ? XFS_SB_VERSION_DALIGNBIT : 0) | \
index 67c460be09d50107c8d2095684b39e6300b6787a..38c28e9215619772fb8ff69dfbbefe59de7e93f6 100644 (file)
@@ -54,11 +54,7 @@ typedef unsigned int         __uint32_t;
 typedef signed long long int   __int64_t;
 typedef unsigned long long int __uint64_t;
 
-#ifndef _BOOLEAN_T_DEFINED
- typedef enum { B_FALSE, B_TRUE } boolean_t;
- #define _BOOLEAN_T_DEFINED 1
-#endif
-
+typedef enum { B_FALSE,B_TRUE }        boolean_t;
 typedef __int64_t              prid_t;         /* project ID */
 typedef __uint32_t             inst_t;         /* an instruction */
 
index 32c6ef16d257d598e014109135b62e7e2b6288c7..21de76e4663a0fc6ddde91f55ab016a0013eace5 100644 (file)
--- a/io/open.c
+++ b/io/open.c
@@ -334,7 +334,7 @@ extsize_f(
        unsigned int            extsize;
        char                    *sp;
 
-       extsize = strtoul(argv[1], &sp, 10);
+       extsize = strtoul(argv[1], &sp, 0);
        if (!sp || sp == argv[1]) {
                printf(_("non-numeric extsize argument -- %s\n"), argv[1]);
                return 0;
index 31cd5437a7372e15803908508b3fd2608b304598..fe0a435749f70558ddd4a05f6d1ed7ae5b64c7b2 100644 (file)
@@ -166,7 +166,7 @@ pread_f(
                printf("%s %s\n", pread_cmd.name, pread_cmd.oneline);
                return 0;
        }
-       offset = strtoul(argv[optind], &sp, 0);
+       offset = (off64_t) strtoull(argv[optind], &sp, 0);
        if (!sp || sp == argv[optind]) {
                printf(_("non-numeric offset argument -- %s\n"), argv[optind]);
                return 0;
index c806cefa3c060916cbd0519d34e1ec1d84e8efdb..745604e66ac837661b4075beac1f4eb05464a8d3 100644 (file)
@@ -49,12 +49,12 @@ offset_length(
 
        memset(segment, 0, sizeof(*segment));
        segment->l_whence = SEEK_SET;
-       segment->l_start = strtoul(offset, &sp, 0);
+       segment->l_start = strtoull(offset, &sp, 0);
        if (!sp || sp == offset) {
                printf(_("non-numeric offset argument -- %s\n"), offset);
                return 0;
        }
-       segment->l_len = strtoul(length, &sp, 0);
+       segment->l_len = strtoull(length, &sp, 0);
        if (!sp || sp == length) {
                printf(_("non-numeric length argument -- %s\n"), length);
                return 0;
index e1fef4b1b15cf1848f0521eca9e112008c4caf9a..1a42bd1231353bb02c9fc6786cfc9456d912a1c0 100644 (file)
@@ -67,7 +67,7 @@ write_buffer(
        off64_t         skip,
        ssize_t         *total)
 {
-       ssize_t         bytes, itotal = min(bs,count);
+       ssize_t         bytes, bytes_requested, itotal = min(bs, count);
 
        *total = 0;
        while (count > 0) {
@@ -75,7 +75,8 @@ write_buffer(
                        if (!read_buffer(fd, skip + *total, bs, &itotal, 0, 1))
                                break;
                }
-               bytes = pwrite64(fdesc, buffer, min(itotal,count), offset);
+               bytes_requested = min(itotal, count);
+               bytes = pwrite64(fdesc, buffer, bytes_requested, offset);
                if (bytes == 0)
                        break;
                if (bytes < 0) {
@@ -83,7 +84,7 @@ write_buffer(
                        return 0;
                }
                *total += bytes;
-               if (bytes < count)
+               if (bytes < bytes_requested)
                        break;
                offset += bytes;
                count -= bytes;
@@ -120,7 +121,7 @@ pwrite_f(
                        infile = optarg;
                        break;
                case 's':
-                       skip = strtoul(optarg, &sp, 0);
+                       skip = (off64_t) strtoull(optarg, &sp, 0);
                        if (!sp || sp == optarg) {
                                printf(_("non-numeric skip -- %s\n"), optarg);
                                return 0;
@@ -142,7 +143,7 @@ pwrite_f(
                printf("%s %s\n", pwrite_cmd.name, pwrite_cmd.oneline);
                return 0;
        }
-       offset = strtoul(argv[optind], &sp, 0);
+       offset = (off64_t) strtoull(argv[optind], &sp, 0);
        if (!sp || sp == argv[optind]) {
                printf(_("non-numeric offset argument -- %s\n"), argv[optind]);
                return 0;
index 38361787db3f857dc5fffa5a81f69167c366b9e1..6c54923937a548346b2e27e9f763da5396f778e8 100644 (file)
@@ -46,7 +46,7 @@ resblks_f(
        char                    *sp;
 
        if (argc == 2) {
-               res.resblks = strtoul(argv[1], &sp, 10);
+               res.resblks = strtoull(argv[1], &sp, 10);
                if (!sp || sp == argv[1]) {
                        printf(_("non-numeric argument -- %s\n"), argv[1]);
                        return 0;
index 49d54d1e93c309ebc466507d1605919b01b0887d..852ba7675b2909e2a9eb44fe9af5803a71b9eeac 100644 (file)
@@ -44,7 +44,7 @@ truncate_f(
        off64_t                 offset;
        char                    *sp;
 
-       offset = strtoul(argv[1], &sp, 10);
+       offset = (off64_t) strtoull(argv[1], &sp, 10);
        if (!sp || sp == argv[1]) {
                printf(_("non-numeric truncate argument -- %s\n"), argv[1]);
                return 0;
index 64009bf90902b9f4c44b7f6c19257874daaaa09c..a6a5d004391d1605b4eb6fc50c0def16f03cf7f8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -70,11 +70,6 @@ md_get_subvol_stripe(
                close(fd);
 
                /* Check state */
-               if (!(md.state & (1 << MD_SB_CLEAN))) {
-                       fprintf(stderr,
-                               _("warning - MD array %s not in clean state\n"),
-                               dfile);
-               }
                if (md.state & (1 << MD_SB_ERRORS)) {
                        fprintf(stderr,
                                _("warning - MD array %s in error state\n"),
index 258e51b18200c47926ef99c0452c7c74a3c0b580..ba388b3093ef8d477619d8f9837d5a71b725d666 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
 
 #define BBTOOFF64(bbs) (((xfs_off_t)(bbs)) << BBSHIFT)
 #define BDSTRAT_SIZE   (256 * 1024)
+#define min(x, y)      ((x) < (y) ? (x) : (y))
 
 void
 libxfs_device_zero(dev_t dev, xfs_daddr_t start, uint len)
 {
-       xfs_daddr_t     bno;
-       uint            nblks;
-       int             size;
-       int             fd;
+       xfs_off_t       start_offset, end_offset, offset;
+       ssize_t         zsize, bytes;
        char            *z;
+       int             fd;
 
-       size = BDSTRAT_SIZE <= BBTOB(len) ? BDSTRAT_SIZE : BBTOB(len);
-       if ((z = memalign(getpagesize(), size)) == NULL) {
+       zsize = min(BDSTRAT_SIZE, BBTOB(len));
+       if ((z = memalign(getpagesize(), zsize)) == NULL) {
                fprintf(stderr,
                        _("%s: %s can't memalign %d bytes: %s\n"),
-                       progname, __FUNCTION__, size, strerror(errno));
+                       progname, __FUNCTION__, zsize, strerror(errno));
                exit(1);
        }
-       memset(z, 0, size);
+       memset(z, 0, zsize);
+
        fd = libxfs_device_to_fd(dev);
-       for (bno = start; bno < start + len; ) {
-               nblks = (uint)BTOBB(size);
-               if (bno + nblks > start + len)
-                       nblks = (uint)(start + len - bno);
-               if (pwrite64(fd, z, BBTOB(nblks), BBTOOFF64(bno)) <
-                               BBTOB(nblks)) {
-                       fprintf(stderr,
-                               _("%s: %s write failed: %s\n"),
+       start_offset = BBTOOFF64(start);
+
+       if ((lseek64(fd, start_offset, SEEK_SET)) < 0) {
+               fprintf(stderr, _("%s: %s seek to offset %llu failed: %s\n"),
+                       progname, __FUNCTION__, start_offset, strerror(errno));
+               exit(1);
+       }
+
+       end_offset = BBTOOFF64(start + len) - start_offset;
+       for (offset = 0; offset < end_offset; ) {
+               bytes = min((ssize_t)(end_offset - offset), zsize);
+               if ((bytes = write(fd, z, bytes)) < 0) {
+                       fprintf(stderr, _("%s: %s write failed: %s\n"),
                                progname, __FUNCTION__, strerror(errno));
                        exit(1);
+               } else if (bytes == 0) {
+                       fprintf(stderr, _("%s: %s not progressing?\n"),
+                               progname, __FUNCTION__);
+                       exit(1);
                }
-               bno += nblks;
+               offset += bytes;
        }
        free(z);
 }
index 25d5a0753733499e1ef763bed34ad528f5047b08..c9549d2009cd26ee46a982b8809066493dce252a 100644 (file)
@@ -190,7 +190,7 @@ xfs_itobp(
                                mp->m_dev, (unsigned long long)imap.im_blkno, i,
                                INT_GET(dip->di_core.di_magic, ARCH_CONVERT));
 #endif
-                       XFS_CORRUPTION_ERROR("xfs_itobp", XFS_ERRLEVEL_LOW,
+                       XFS_CORRUPTION_ERROR("xfs_itobp", XFS_ERRLEVEL_HIGH,
                                             mp, dip);
                        xfs_trans_brelse(tp, bp);
                        return XFS_ERROR(EFSCORRUPTED);
index 9c974bfae121a58878baf96c22f88fbdf359df0c..520c548aa2d42aa1aea9ee9980e8687d5e4ddaca 100644 (file)
@@ -608,8 +608,8 @@ The
 .B size
 suboption is used to specify the size of the real-time section.
 This suboption is only needed if the real-time section of the
-filesystem should occupy
-less space than the size of the partition or logical volume containing the section.
+filesystem should occupy less space than the size of the partition
+or logical volume containing the section.
 .TP
 .B \-s
 Sector size options.
@@ -625,10 +625,9 @@ The sector size is specified either as a base two logarithm value with
 or in bytes with
 .BR size= .
 The default value is 512 bytes.
-.\" The minimum value for sector size is 512; the maximum is 32768 (32 KB).
-.\" The sector size cannot be made larger than the filesystem block size.
-This option is not yet implemented and sector size other than 512
-bytes cannot be set at this stage.
+The minimum value for sector size is 512; the maximum is 32768 (32 KB).
+The sector size must be a power of 2 size and cannot be made larger
+than the filesystem block size.
 .TP
 \f3\-L\f1 \f2label\f1
 Set the filesystem label.
index ca43d9942a5f2373c25f4d81cd1dfd127c069280..b5da5d672ce36d647d5635aaef8a0e473b169dee 100644 (file)
@@ -1096,21 +1096,6 @@ main(
                logversion = 2;
        }
 
-       /*
-        * Support for non-512 byte sector sizes is a work-in-progress...
-        */
-
-#ifndef EXPERIMENTAL_LARGE_SECTORS
-       if (sectorsize != XFS_MIN_SECTORSIZE) {
-               fprintf(stderr, _("unsupported sector size %d\n"), sectorsize);
-               usage();
-       }
-       if (lsectorsize != XFS_MIN_SECTORSIZE) {
-               fprintf(stderr, _("unsupported log sector size %d\n"), lsectorsize);
-               usage();
-       }
-#endif
-
        if (!nvflag)
                dirversion = (nsflag || nlflag) ? 2 : XFS_DFL_DIR_VERSION;
        switch (dirversion) {
@@ -1423,6 +1408,8 @@ reported by the device (%u).\n"),
                                [dirblocklog - XFS_MIN_BLOCKSIZE_LOG];
        ASSERT(i);
        min_logblocks = MAX(XFS_MIN_LOG_BLOCKS, i * XFS_MIN_LOG_FACTOR);
+       if (!logsize && dblocks >= (1024*1024*1024) >> blocklog)
+               min_logblocks = MAX(min_logblocks, (10*1024*1024)>>blocklog);
        if (logsize && xi.logBBsize > 0 && logblocks > DTOBT(xi.logBBsize)) {
                fprintf(stderr,
 _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"),
@@ -1443,11 +1430,11 @@ _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"),
        else if (loginternal && !logsize) {
                /*
                 * logblocks grows from min_logblocks to XFS_MAX_LOG_BLOCKS
-                * at 1TB
+                * at 128GB
                 *
-                * 8192 = 1TB / MAX_LOG_BYTES
+                * 2048 = 128GB / MAX_LOG_BYTES
                 */
-               logblocks = (dblocks << blocklog) / 8192;
+               logblocks = (dblocks << blocklog) / 2048;
                logblocks = logblocks >> blocklog;
                logblocks = MAX(min_logblocks, logblocks);
                logblocks = MAX(logblocks,
index de7fc50b1b4b9c1e6419874b12490ed6ff203ac8..ef9e03526b0be9b4102b98c281ac23bb11f112bf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -219,6 +219,8 @@ calc_ino_align(xfs_sb_t *sb)
  * sector size info -
  *                     sb_sectsize
  *                     sb_sectlog
+ *                     sb_logsectsize
+ *                     sb_logsectlog
  *
  * not checked here -
  *                     sb_rootino
@@ -258,11 +260,11 @@ verify_sb(xfs_sb_t *sb, int is_primary_sb)
 
        bsize = 1;
 
-       for (i = 0; bsize < sb->sb_blocksize && i < 32; i++)  {
+       for (i = 0; bsize < sb->sb_blocksize &&
+               i < sizeof(sb->sb_blocksize) * NBBY; i++)
                bsize <<= 1;
-       }
 
-       if (i < XR_LOG2BSIZE_MIN || i > XR_LOG2BSIZE_MAX)
+       if (i < XFS_MIN_BLOCKSIZE_LOG || i > XFS_MAX_BLOCKSIZE_LOG)
                return(XR_BAD_BLOCKSIZE);
 
        /* check sb blocksize field against sb blocklog field */
@@ -273,9 +275,11 @@ verify_sb(xfs_sb_t *sb, int is_primary_sb)
        /* sanity check ag count, size fields against data size field */
 
        if (sb->sb_dblocks == 0 ||
-               sb->sb_dblocks > sb->sb_agcount * sb->sb_agblocks ||
-               sb->sb_dblocks < (sb->sb_agcount - 1)
-                       * sb->sb_agblocks + XFS_MIN_AG_BLOCKS)
+               sb->sb_dblocks >
+                       (__uint64_t)(sb->sb_agcount * sb->sb_agblocks) ||
+               sb->sb_dblocks <
+                       (__uint64_t)((sb->sb_agcount - 1) * sb->sb_agblocks
+                       + XFS_MIN_AG_BLOCKS))
                return(XR_BAD_FS_SIZE_DATA);
 
        if (sb->sb_agblklog != (__uint8_t)libxfs_log2_roundup(sb->sb_agblocks))
@@ -286,18 +290,49 @@ verify_sb(xfs_sb_t *sb, int is_primary_sb)
                sb->sb_inopblock != howmany(sb->sb_blocksize,sb->sb_inodesize))
                return(XR_BAD_INO_SIZE_DATA);
 
-       /* check sector size against log(sector size) field */
+       /* check to make sure sectorsize is legal 2^N, 9 <= N <= 15 */
+
+       if (sb->sb_sectsize == 0)
+               return(XR_BAD_SECT_SIZE_DATA);
 
        bsize = 1;
 
-       for (i = 0; bsize < sb->sb_sectsize && i < 15; i++)  {
+       for (i = 0; bsize < sb->sb_sectsize &&
+               i < sizeof(sb->sb_sectsize) * NBBY; i++)  {
                bsize <<= 1;
        }
 
-       if (sb->sb_sectsize == 0 || i == 16 ||
-                       sb->sb_sectsize != (1 << i))
+       if (i < XFS_MIN_SECTORSIZE_LOG || i > XFS_MAX_SECTORSIZE_LOG)
+               return(XR_BAD_SECT_SIZE_DATA);
+
+       /* check sb sectorsize field against sb sectlog field */
+
+       if (i != sb->sb_sectlog)
                return(XR_BAD_SECT_SIZE_DATA);
 
+       if (XFS_SB_VERSION_HASSECTOR(sb))  {
+
+               /* check to make sure log sector is legal 2^N, 9 <= N <= 15 */
+
+               if (sb->sb_logsectsize == 0)
+                       return(XR_BAD_SECT_SIZE_DATA);
+
+               bsize = 1;
+
+               for (i = 0; bsize < sb->sb_logsectsize &&
+                       i < sizeof(sb->sb_logsectsize) * NBBY; i++)  {
+                       bsize <<= 1;
+               }
+
+               if (i < XFS_MIN_SECTORSIZE_LOG || i > XFS_MAX_SECTORSIZE_LOG)
+                       return(XR_BAD_SECT_SIZE_DATA);
+
+               /* check sb log sectorsize field against sb log sectlog field */
+
+               if (i != sb->sb_logsectlog)
+                       return(XR_BAD_SECT_SIZE_DATA);
+       }
+
        /*
         * real-time extent size is always set
         */