From: Dave Chinner <david@fromorbit.com>
To: xfs@oss.sgi.com
Subject: [PATCH 4/5] xfs: don't need dirv2 checks anymore
Date: Tue, 6 May 2014 13:55:58 +1000 [thread overview]
Message-ID: <1399348559-19889-5-git-send-email-david@fromorbit.com> (raw)
In-Reply-To: <1399348559-19889-1-git-send-email-david@fromorbit.com>
From: Dave Chinner <dchinner@redhat.com>
If the the V2 directory feature bit is not set in the superblock
feature mask the filesystem will fail the good version check.
Hence we don't need any other version checking on the dir2 feature
bit in the code as the filesystem will not mount without it set.
Remove the checking code.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
fs/xfs/xfs_dir2.c | 2 +-
fs/xfs/xfs_fsops.c | 3 +--
fs/xfs/xfs_sb.c | 9 ---------
fs/xfs/xfs_sb.h | 6 ------
4 files changed, 2 insertions(+), 18 deletions(-)
diff --git a/fs/xfs/xfs_dir2.c b/fs/xfs/xfs_dir2.c
index e365c98..93fcebd 100644
--- a/fs/xfs/xfs_dir2.c
+++ b/fs/xfs/xfs_dir2.c
@@ -92,7 +92,7 @@ xfs_dir_mount(
int nodehdr_size;
- ASSERT(xfs_sb_version_hasdirv2(&mp->m_sb));
+ ASSERT(mp->m_sb.sb_versionnum & XFS_SB_VERSION_DIRV2BIT);
ASSERT((1 << (mp->m_sb.sb_blocklog + mp->m_sb.sb_dirblklog)) <=
XFS_MAX_BLOCKSIZE);
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c
index 2a03f2d..b099799 100644
--- a/fs/xfs/xfs_fsops.c
+++ b/fs/xfs/xfs_fsops.c
@@ -75,6 +75,7 @@ xfs_fs_geometry(
if (new_version >= 3) {
geo->version = XFS_FSOP_GEOM_VERSION;
geo->flags = XFS_FSOP_GEOM_FLAGS_NLINK |
+ XFS_FSOP_GEOM_FLAGS_DIRV2 |
(xfs_sb_version_hasattr(&mp->m_sb) ?
XFS_FSOP_GEOM_FLAGS_ATTR : 0) |
(xfs_sb_version_hasquota(&mp->m_sb) ?
@@ -87,8 +88,6 @@ xfs_fs_geometry(
XFS_FSOP_GEOM_FLAGS_SHARED : 0) |
(xfs_sb_version_hasextflgbit(&mp->m_sb) ?
XFS_FSOP_GEOM_FLAGS_EXTFLG : 0) |
- (xfs_sb_version_hasdirv2(&mp->m_sb) ?
- XFS_FSOP_GEOM_FLAGS_DIRV2 : 0) |
(xfs_sb_version_hassector(&mp->m_sb) ?
XFS_FSOP_GEOM_FLAGS_SECTOR : 0) |
(xfs_sb_version_hasasciici(&mp->m_sb) ?
diff --git a/fs/xfs/xfs_sb.c b/fs/xfs/xfs_sb.c
index 8baf61a..de16dd5 100644
--- a/fs/xfs/xfs_sb.c
+++ b/fs/xfs/xfs_sb.c
@@ -333,15 +333,6 @@ xfs_mount_validate_sb(
xfs_warn(mp, "Offline file system operation in progress!");
return XFS_ERROR(EFSCORRUPTED);
}
-
- /*
- * Version 1 directory format has never worked on Linux.
- */
- if (unlikely(!xfs_sb_version_hasdirv2(sbp))) {
- xfs_warn(mp, "file system using version 1 directory format");
- return XFS_ERROR(ENOSYS);
- }
-
return 0;
}
diff --git a/fs/xfs/xfs_sb.h b/fs/xfs/xfs_sb.h
index b238a0e..9aa5caa 100644
--- a/fs/xfs/xfs_sb.h
+++ b/fs/xfs/xfs_sb.h
@@ -403,12 +403,6 @@ static inline bool xfs_sb_version_hasshared(struct xfs_sb *sbp)
(sbp->sb_versionnum & XFS_SB_VERSION_SHAREDBIT);
}
-static inline bool xfs_sb_version_hasdirv2(struct xfs_sb *sbp)
-{
- return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5 ||
- (sbp->sb_versionnum & XFS_SB_VERSION_DIRV2BIT);
-}
-
static inline bool xfs_sb_version_haslogv2(struct xfs_sb *sbp)
{
return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5 ||
--
1.9.0
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2014-05-06 3:56 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-06 3:55 [PATCH 0/5] xfs: sanitise supberlock feature bit support Dave Chinner
2014-05-06 3:55 ` [PATCH 1/5] xfs: make superblock version checks reflect reality Dave Chinner
2014-05-06 8:29 ` Christoph Hellwig
2014-05-06 8:39 ` Dave Chinner
2014-05-06 3:55 ` [PATCH 2/5] xfs: keep sb_bad_features2 the same a sb_features2 Dave Chinner
2014-05-06 8:20 ` Christoph Hellwig
2014-05-06 3:55 ` [PATCH 3/5] xfs: turn NLINK feature on by default Dave Chinner
2014-05-06 8:15 ` Christoph Hellwig
2014-05-06 9:06 ` Dave Chinner
2014-05-06 3:55 ` Dave Chinner [this message]
2014-05-06 8:16 ` [PATCH 4/5] xfs: don't need dirv2 checks anymore Christoph Hellwig
2014-05-06 8:45 ` Dave Chinner
2014-05-06 3:55 ` [PATCH 5/5] xfs: remove shared supberlock feature checking Dave Chinner
2014-05-06 7:48 ` Jeff Liu
2014-05-06 8:02 ` Dave Chinner
2014-05-06 8:18 ` Christoph Hellwig
2014-05-06 8:28 ` Dave Chinner
-- strict thread matches above, loose matches on Subject: below --
2014-05-16 23:00 [PATCH 0/5 V2] xfs: sanitise superblock feature bit support Dave Chinner
2014-05-16 23:00 ` [PATCH 4/5] xfs: don't need dirv2 checks anymore Dave Chinner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1399348559-19889-5-git-send-email-david@fromorbit.com \
--to=david@fromorbit.com \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox