提交 1bd960ee 编写于 作者: J Josef Jeff Sipek 提交者: Niv Sardi

[XFS] If you mount an XFS filesystem with no mount options at all, then

the "ikeep" option is set rather than "noikeep".

This regression was introduced in 970451.

With no mount options specified, xfs_parseargs() does the following:

int ikeep = 0;

args->flags |= XFSMNT_BARRIER;

args->flags2 |= XFSMNT2_COMPAT_IOSIZE;

if (!options)

goto done;

It only sets the above two options by default and before, it also used to
set XFSMNT_IDELETE by default.

If options are specified, then

if (!(args->flags & XFSMNT_DMAPI) && !ikeep)

args->flags |= XFSMNT_IDELETE;

is executed later on which is skipped by the "goto done;" above.

The solution is to invert the logic.

SGI-PV: 977771
SGI-Modid: xfs-linux-melb:xfs-kern:30590a
Signed-off-by: NNiv Sardi <xaiki@sgi.com>
Signed-off-by: NBarry Naujok <bnaujok@sgi.com>
Signed-off-by: NJosef 'Jeff' Sipek <jeffpc@josefsipek.net>
Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
上级 7704a8b6
...@@ -171,7 +171,7 @@ xfs_parseargs( ...@@ -171,7 +171,7 @@ xfs_parseargs(
char *this_char, *value, *eov; char *this_char, *value, *eov;
int dsunit, dswidth, vol_dsunit, vol_dswidth; int dsunit, dswidth, vol_dsunit, vol_dswidth;
int iosize; int iosize;
int ikeep = 0; int dmapi_implies_ikeep = 1;
args->flags |= XFSMNT_BARRIER; args->flags |= XFSMNT_BARRIER;
args->flags2 |= XFSMNT2_COMPAT_IOSIZE; args->flags2 |= XFSMNT2_COMPAT_IOSIZE;
...@@ -302,10 +302,10 @@ xfs_parseargs( ...@@ -302,10 +302,10 @@ xfs_parseargs(
} else if (!strcmp(this_char, MNTOPT_NOBARRIER)) { } else if (!strcmp(this_char, MNTOPT_NOBARRIER)) {
args->flags &= ~XFSMNT_BARRIER; args->flags &= ~XFSMNT_BARRIER;
} else if (!strcmp(this_char, MNTOPT_IKEEP)) { } else if (!strcmp(this_char, MNTOPT_IKEEP)) {
ikeep = 1; args->flags |= XFSMNT_IKEEP;
args->flags &= ~XFSMNT_IDELETE;
} else if (!strcmp(this_char, MNTOPT_NOIKEEP)) { } else if (!strcmp(this_char, MNTOPT_NOIKEEP)) {
args->flags |= XFSMNT_IDELETE; dmapi_implies_ikeep = 0;
args->flags &= ~XFSMNT_IKEEP;
} else if (!strcmp(this_char, MNTOPT_LARGEIO)) { } else if (!strcmp(this_char, MNTOPT_LARGEIO)) {
args->flags2 &= ~XFSMNT2_COMPAT_IOSIZE; args->flags2 &= ~XFSMNT2_COMPAT_IOSIZE;
} else if (!strcmp(this_char, MNTOPT_NOLARGEIO)) { } else if (!strcmp(this_char, MNTOPT_NOLARGEIO)) {
...@@ -410,8 +410,8 @@ xfs_parseargs( ...@@ -410,8 +410,8 @@ xfs_parseargs(
* Note that if "ikeep" or "noikeep" mount options are * Note that if "ikeep" or "noikeep" mount options are
* supplied, then they are honored. * supplied, then they are honored.
*/ */
if (!(args->flags & XFSMNT_DMAPI) && !ikeep) if ((args->flags & XFSMNT_DMAPI) && dmapi_implies_ikeep)
args->flags |= XFSMNT_IDELETE; args->flags |= XFSMNT_IKEEP;
if ((args->flags & XFSMNT_NOALIGN) != XFSMNT_NOALIGN) { if ((args->flags & XFSMNT_NOALIGN) != XFSMNT_NOALIGN) {
if (dsunit) { if (dsunit) {
...@@ -446,6 +446,7 @@ xfs_showargs( ...@@ -446,6 +446,7 @@ xfs_showargs(
{ {
static struct proc_xfs_info xfs_info_set[] = { static struct proc_xfs_info xfs_info_set[] = {
/* the few simple ones we can get from the mount struct */ /* the few simple ones we can get from the mount struct */
{ XFS_MOUNT_IKEEP, "," MNTOPT_IKEEP },
{ XFS_MOUNT_WSYNC, "," MNTOPT_WSYNC }, { XFS_MOUNT_WSYNC, "," MNTOPT_WSYNC },
{ XFS_MOUNT_INO64, "," MNTOPT_INO64 }, { XFS_MOUNT_INO64, "," MNTOPT_INO64 },
{ XFS_MOUNT_NOALIGN, "," MNTOPT_NOALIGN }, { XFS_MOUNT_NOALIGN, "," MNTOPT_NOALIGN },
...@@ -461,7 +462,6 @@ xfs_showargs( ...@@ -461,7 +462,6 @@ xfs_showargs(
}; };
static struct proc_xfs_info xfs_info_unset[] = { static struct proc_xfs_info xfs_info_unset[] = {
/* the few simple ones we can get from the mount struct */ /* the few simple ones we can get from the mount struct */
{ XFS_MOUNT_IDELETE, "," MNTOPT_IKEEP },
{ XFS_MOUNT_COMPAT_IOSIZE, "," MNTOPT_LARGEIO }, { XFS_MOUNT_COMPAT_IOSIZE, "," MNTOPT_LARGEIO },
{ XFS_MOUNT_BARRIER, "," MNTOPT_NOBARRIER }, { XFS_MOUNT_BARRIER, "," MNTOPT_NOBARRIER },
{ XFS_MOUNT_SMALL_INUMS, "," MNTOPT_64BITINODE }, { XFS_MOUNT_SMALL_INUMS, "," MNTOPT_64BITINODE },
......
...@@ -86,7 +86,7 @@ struct xfs_mount_args { ...@@ -86,7 +86,7 @@ struct xfs_mount_args {
#define XFSMNT_NOUUID 0x01000000 /* Ignore fs uuid */ #define XFSMNT_NOUUID 0x01000000 /* Ignore fs uuid */
#define XFSMNT_DMAPI 0x02000000 /* enable dmapi/xdsm */ #define XFSMNT_DMAPI 0x02000000 /* enable dmapi/xdsm */
#define XFSMNT_BARRIER 0x04000000 /* use write barriers */ #define XFSMNT_BARRIER 0x04000000 /* use write barriers */
#define XFSMNT_IDELETE 0x08000000 /* inode cluster delete */ #define XFSMNT_IKEEP 0x08000000 /* inode cluster delete */
#define XFSMNT_SWALLOC 0x10000000 /* turn on stripe width #define XFSMNT_SWALLOC 0x10000000 /* turn on stripe width
* allocation */ * allocation */
#define XFSMNT_DIRSYNC 0x40000000 /* sync creat,link,unlink,rename #define XFSMNT_DIRSYNC 0x40000000 /* sync creat,link,unlink,rename
......
...@@ -1053,7 +1053,7 @@ xfs_difree( ...@@ -1053,7 +1053,7 @@ xfs_difree(
/* /*
* When an inode cluster is free, it becomes eligible for removal * When an inode cluster is free, it becomes eligible for removal
*/ */
if ((mp->m_flags & XFS_MOUNT_IDELETE) && if (!(mp->m_flags & XFS_MOUNT_IKEEP) &&
(rec.ir_freecount == XFS_IALLOC_INODES(mp))) { (rec.ir_freecount == XFS_IALLOC_INODES(mp))) {
*delete = 1; *delete = 1;
......
...@@ -366,7 +366,7 @@ typedef struct xfs_mount { ...@@ -366,7 +366,7 @@ typedef struct xfs_mount {
#define XFS_MOUNT_SMALL_INUMS (1ULL << 15) /* users wants 32bit inodes */ #define XFS_MOUNT_SMALL_INUMS (1ULL << 15) /* users wants 32bit inodes */
#define XFS_MOUNT_NOUUID (1ULL << 16) /* ignore uuid during mount */ #define XFS_MOUNT_NOUUID (1ULL << 16) /* ignore uuid during mount */
#define XFS_MOUNT_BARRIER (1ULL << 17) #define XFS_MOUNT_BARRIER (1ULL << 17)
#define XFS_MOUNT_IDELETE (1ULL << 18) /* delete empty inode clusters*/ #define XFS_MOUNT_IKEEP (1ULL << 18) /* keep empty inode clusters*/
#define XFS_MOUNT_SWALLOC (1ULL << 19) /* turn on stripe width #define XFS_MOUNT_SWALLOC (1ULL << 19) /* turn on stripe width
* allocation */ * allocation */
#define XFS_MOUNT_RDONLY (1ULL << 20) /* read-only fs */ #define XFS_MOUNT_RDONLY (1ULL << 20) /* read-only fs */
......
...@@ -281,8 +281,8 @@ xfs_start_flags( ...@@ -281,8 +281,8 @@ xfs_start_flags(
mp->m_readio_log = mp->m_writeio_log = ap->iosizelog; mp->m_readio_log = mp->m_writeio_log = ap->iosizelog;
} }
if (ap->flags & XFSMNT_IDELETE) if (ap->flags & XFSMNT_IKEEP)
mp->m_flags |= XFS_MOUNT_IDELETE; mp->m_flags |= XFS_MOUNT_IKEEP;
if (ap->flags & XFSMNT_DIRSYNC) if (ap->flags & XFSMNT_DIRSYNC)
mp->m_flags |= XFS_MOUNT_DIRSYNC; mp->m_flags |= XFS_MOUNT_DIRSYNC;
if (ap->flags & XFSMNT_ATTR2) if (ap->flags & XFSMNT_ATTR2)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册