aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorJie Liu <jeff.liu@oracle.com>2013-05-02 07:27:47 -0400
committerBen Myers <bpm@sgi.com>2013-06-19 15:54:17 -0400
commit39a45d8463d98ea57347b871641136be64b216a9 (patch)
tree7184b8d6abaec378fc41d007fe45dc1abfce99e5 /fs/xfs
parent2fb8b5027dbde32a45edf5f3d7ee082be9261d93 (diff)
xfs: Remove XFS_MOUNT_RETERR
XFS_MOUNT_RETERR is going to be set at xfs_parseargs() if mp->m_dalign is enabled, so any time we enter "if (mp->m_dalign)" branch in xfs_update_alignment(), XFS_MOUNT_RETERR is set and so we always be emitting a warning and returning an error. Hence, we can remove it and get rid of a couple of redundant check up against it at xfs_upate_alignment(). Thanks Dave Chinner for the suggestions of simplify the code in xfs_parseargs(). Signed-off-by: Jie Liu <jeff.liu@oracle.com> Cc: Dave Chinner <dchinner@redhat.com> Cc: Mark Tinguely <tinguely@sgi.com> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_mount.c37
-rw-r--r--fs/xfs/xfs_mount.h2
-rw-r--r--fs/xfs/xfs_super.c11
3 files changed, 14 insertions, 36 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 6a19434eba2a..2978bb4cc72a 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -987,42 +987,27 @@ xfs_update_alignment(xfs_mount_t *mp)
987 */ 987 */
988 if ((BBTOB(mp->m_dalign) & mp->m_blockmask) || 988 if ((BBTOB(mp->m_dalign) & mp->m_blockmask) ||
989 (BBTOB(mp->m_swidth) & mp->m_blockmask)) { 989 (BBTOB(mp->m_swidth) & mp->m_blockmask)) {
990 if (mp->m_flags & XFS_MOUNT_RETERR) { 990 xfs_warn(mp,
991 xfs_warn(mp, "alignment check failed: " 991 "alignment check failed: sunit/swidth vs. blocksize(%d)",
992 "(sunit/swidth vs. blocksize)"); 992 sbp->sb_blocksize);
993 return XFS_ERROR(EINVAL); 993 return XFS_ERROR(EINVAL);
994 }
995 mp->m_dalign = mp->m_swidth = 0;
996 } else { 994 } else {
997 /* 995 /*
998 * Convert the stripe unit and width to FSBs. 996 * Convert the stripe unit and width to FSBs.
999 */ 997 */
1000 mp->m_dalign = XFS_BB_TO_FSBT(mp, mp->m_dalign); 998 mp->m_dalign = XFS_BB_TO_FSBT(mp, mp->m_dalign);
1001 if (mp->m_dalign && (sbp->sb_agblocks % mp->m_dalign)) { 999 if (mp->m_dalign && (sbp->sb_agblocks % mp->m_dalign)) {
1002 if (mp->m_flags & XFS_MOUNT_RETERR) {
1003 xfs_warn(mp, "alignment check failed: "
1004 "(sunit/swidth vs. ag size)");
1005 return XFS_ERROR(EINVAL);
1006 }
1007 xfs_warn(mp, 1000 xfs_warn(mp,
1008 "stripe alignment turned off: sunit(%d)/swidth(%d) " 1001 "alignment check failed: sunit/swidth vs. agsize(%d)",
1009 "incompatible with agsize(%d)", 1002 sbp->sb_agblocks);
1010 mp->m_dalign, mp->m_swidth, 1003 return XFS_ERROR(EINVAL);
1011 sbp->sb_agblocks);
1012
1013 mp->m_dalign = 0;
1014 mp->m_swidth = 0;
1015 } else if (mp->m_dalign) { 1004 } else if (mp->m_dalign) {
1016 mp->m_swidth = XFS_BB_TO_FSBT(mp, mp->m_swidth); 1005 mp->m_swidth = XFS_BB_TO_FSBT(mp, mp->m_swidth);
1017 } else { 1006 } else {
1018 if (mp->m_flags & XFS_MOUNT_RETERR) { 1007 xfs_warn(mp,
1019 xfs_warn(mp, "alignment check failed: " 1008 "alignment check failed: sunit(%d) less than bsize(%d)",
1020 "sunit(%d) less than bsize(%d)", 1009 mp->m_dalign, sbp->sb_blocksize);
1021 mp->m_dalign, 1010 return XFS_ERROR(EINVAL);
1022 mp->m_blockmask +1);
1023 return XFS_ERROR(EINVAL);
1024 }
1025 mp->m_swidth = 0;
1026 } 1011 }
1027 } 1012 }
1028 1013
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index de7abf677abe..4e374d4a9189 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -227,8 +227,6 @@ typedef struct xfs_mount {
227 operations, typically for 227 operations, typically for
228 disk errors in metadata */ 228 disk errors in metadata */
229#define XFS_MOUNT_DISCARD (1ULL << 5) /* discard unused blocks */ 229#define XFS_MOUNT_DISCARD (1ULL << 5) /* discard unused blocks */
230#define XFS_MOUNT_RETERR (1ULL << 6) /* return alignment errors to
231 user */
232#define XFS_MOUNT_NOALIGN (1ULL << 7) /* turn off stripe alignment 230#define XFS_MOUNT_NOALIGN (1ULL << 7) /* turn off stripe alignment
233 allocations */ 231 allocations */
234#define XFS_MOUNT_ATTR2 (1ULL << 8) /* allow use of attr2 format */ 232#define XFS_MOUNT_ATTR2 (1ULL << 8) /* allow use of attr2 format */
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 3033ba5e9762..14924099bcb8 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -439,20 +439,15 @@ xfs_parseargs(
439 } 439 }
440 440
441done: 441done:
442 if (!(mp->m_flags & XFS_MOUNT_NOALIGN)) { 442 if (dsunit && !(mp->m_flags & XFS_MOUNT_NOALIGN)) {
443 /* 443 /*
444 * At this point the superblock has not been read 444 * At this point the superblock has not been read
445 * in, therefore we do not know the block size. 445 * in, therefore we do not know the block size.
446 * Before the mount call ends we will convert 446 * Before the mount call ends we will convert
447 * these to FSBs. 447 * these to FSBs.
448 */ 448 */
449 if (dsunit) { 449 mp->m_dalign = dsunit;
450 mp->m_dalign = dsunit; 450 mp->m_swidth = dswidth;
451 mp->m_flags |= XFS_MOUNT_RETERR;
452 }
453
454 if (dswidth)
455 mp->m_swidth = dswidth;
456 } 451 }
457 452
458 if (mp->m_logbufs != -1 && 453 if (mp->m_logbufs != -1 &&