Commit 4baba809 authored by Stephen Lord's avatar Stephen Lord

[XFS] fix sign of error return in mount update and statfs operations,

mount update could have returned either sign, and statfs was 
just wrong.

SGI Modid: 2.5.x-xfs:slinx:150137a
parent 0b59b42f
...@@ -483,7 +483,7 @@ linvfs_statfs( ...@@ -483,7 +483,7 @@ linvfs_statfs(
int error; int error;
VFS_STATVFS(vfsp, statp, NULL, error); VFS_STATVFS(vfsp, statp, NULL, error);
return error; return -error;
} }
STATIC int STATIC int
...@@ -500,7 +500,7 @@ linvfs_remount( ...@@ -500,7 +500,7 @@ linvfs_remount(
if (!error) if (!error)
VFS_MNTUPDATE(vfsp, flags, args, error); VFS_MNTUPDATE(vfsp, flags, args, error);
kmem_free(args, sizeof(*args)); kmem_free(args, sizeof(*args));
return error; return -error;
} }
STATIC void STATIC void
......
...@@ -1619,7 +1619,7 @@ xfs_parseargs( ...@@ -1619,7 +1619,7 @@ xfs_parseargs(
if (!value || !*value) { if (!value || !*value) {
printk("XFS: %s option requires an argument\n", printk("XFS: %s option requires an argument\n",
MNTOPT_LOGBUFS); MNTOPT_LOGBUFS);
return -EINVAL; return EINVAL;
} }
args->logbufs = simple_strtoul(value, &eov, 10); args->logbufs = simple_strtoul(value, &eov, 10);
} else if (!strcmp(this_char, MNTOPT_LOGBSIZE)) { } else if (!strcmp(this_char, MNTOPT_LOGBSIZE)) {
...@@ -1628,7 +1628,7 @@ xfs_parseargs( ...@@ -1628,7 +1628,7 @@ xfs_parseargs(
if (!value || !*value) { if (!value || !*value) {
printk("XFS: %s option requires an argument\n", printk("XFS: %s option requires an argument\n",
MNTOPT_LOGBSIZE); MNTOPT_LOGBSIZE);
return -EINVAL; return EINVAL;
} }
last = strlen(value) - 1; last = strlen(value) - 1;
if (value[last] == 'K' || value[last] == 'k') { if (value[last] == 'K' || value[last] == 'k') {
...@@ -1642,28 +1642,28 @@ xfs_parseargs( ...@@ -1642,28 +1642,28 @@ xfs_parseargs(
if (!value || !*value) { if (!value || !*value) {
printk("XFS: %s option requires an argument\n", printk("XFS: %s option requires an argument\n",
MNTOPT_LOGDEV); MNTOPT_LOGDEV);
return -EINVAL; return EINVAL;
} }
strncpy(args->logname, value, MAXNAMELEN); strncpy(args->logname, value, MAXNAMELEN);
} else if (!strcmp(this_char, MNTOPT_MTPT)) { } else if (!strcmp(this_char, MNTOPT_MTPT)) {
if (!value || !*value) { if (!value || !*value) {
printk("XFS: %s option requires an argument\n", printk("XFS: %s option requires an argument\n",
MNTOPT_MTPT); MNTOPT_MTPT);
return -EINVAL; return EINVAL;
} }
strncpy(args->mtpt, value, MAXNAMELEN); strncpy(args->mtpt, value, MAXNAMELEN);
} else if (!strcmp(this_char, MNTOPT_RTDEV)) { } else if (!strcmp(this_char, MNTOPT_RTDEV)) {
if (!value || !*value) { if (!value || !*value) {
printk("XFS: %s option requires an argument\n", printk("XFS: %s option requires an argument\n",
MNTOPT_RTDEV); MNTOPT_RTDEV);
return -EINVAL; return EINVAL;
} }
strncpy(args->rtname, value, MAXNAMELEN); strncpy(args->rtname, value, MAXNAMELEN);
} else if (!strcmp(this_char, MNTOPT_BIOSIZE)) { } else if (!strcmp(this_char, MNTOPT_BIOSIZE)) {
if (!value || !*value) { if (!value || !*value) {
printk("XFS: %s option requires an argument\n", printk("XFS: %s option requires an argument\n",
MNTOPT_BIOSIZE); MNTOPT_BIOSIZE);
return -EINVAL; return EINVAL;
} }
iosize = simple_strtoul(value, &eov, 10); iosize = simple_strtoul(value, &eov, 10);
args->flags |= XFSMNT_IOSIZE; args->flags |= XFSMNT_IOSIZE;
...@@ -1679,7 +1679,7 @@ xfs_parseargs( ...@@ -1679,7 +1679,7 @@ xfs_parseargs(
#ifndef XFS_BIG_FILESYSTEMS #ifndef XFS_BIG_FILESYSTEMS
printk("XFS: %s option not allowed on this system\n", printk("XFS: %s option not allowed on this system\n",
MNTOPT_INO64); MNTOPT_INO64);
return -EINVAL; return EINVAL;
#endif #endif
} else if (!strcmp(this_char, MNTOPT_NOALIGN)) { } else if (!strcmp(this_char, MNTOPT_NOALIGN)) {
args->flags |= XFSMNT_NOALIGN; args->flags |= XFSMNT_NOALIGN;
...@@ -1687,14 +1687,14 @@ xfs_parseargs( ...@@ -1687,14 +1687,14 @@ xfs_parseargs(
if (!value || !*value) { if (!value || !*value) {
printk("XFS: %s option requires an argument\n", printk("XFS: %s option requires an argument\n",
MNTOPT_SUNIT); MNTOPT_SUNIT);
return -EINVAL; return EINVAL;
} }
dsunit = simple_strtoul(value, &eov, 10); dsunit = simple_strtoul(value, &eov, 10);
} else if (!strcmp(this_char, MNTOPT_SWIDTH)) { } else if (!strcmp(this_char, MNTOPT_SWIDTH)) {
if (!value || !*value) { if (!value || !*value) {
printk("XFS: %s option requires an argument\n", printk("XFS: %s option requires an argument\n",
MNTOPT_SWIDTH); MNTOPT_SWIDTH);
return -EINVAL; return EINVAL;
} }
dswidth = simple_strtoul(value, &eov, 10); dswidth = simple_strtoul(value, &eov, 10);
} else if (!strcmp(this_char, MNTOPT_NOUUID)) { } else if (!strcmp(this_char, MNTOPT_NOUUID)) {
...@@ -1708,33 +1708,33 @@ printk("XFS: osyncisdsync is now the default, option is deprecated.\n"); ...@@ -1708,33 +1708,33 @@ printk("XFS: osyncisdsync is now the default, option is deprecated.\n");
printk("XFS: irixsgid is now a sysctl(2) variable, option is deprecated.\n"); printk("XFS: irixsgid is now a sysctl(2) variable, option is deprecated.\n");
} else { } else {
printk("XFS: unknown mount option [%s].\n", this_char); printk("XFS: unknown mount option [%s].\n", this_char);
return -EINVAL; return EINVAL;
} }
} }
if (args->flags & XFSMNT_NORECOVERY) { if (args->flags & XFSMNT_NORECOVERY) {
if ((vfsp->vfs_flag & VFS_RDONLY) == 0) { if ((vfsp->vfs_flag & VFS_RDONLY) == 0) {
printk("XFS: no-recovery mounts must be read-only.\n"); printk("XFS: no-recovery mounts must be read-only.\n");
return -EINVAL; return EINVAL;
} }
} }
if ((args->flags & XFSMNT_NOALIGN) && (dsunit || dswidth)) { if ((args->flags & XFSMNT_NOALIGN) && (dsunit || dswidth)) {
printk( printk(
"XFS: sunit and swidth options incompatible with the noalign option\n"); "XFS: sunit and swidth options incompatible with the noalign option\n");
return -EINVAL; return EINVAL;
} }
if ((dsunit && !dswidth) || (!dsunit && dswidth)) { if ((dsunit && !dswidth) || (!dsunit && dswidth)) {
printk("XFS: sunit and swidth must be specified together\n"); printk("XFS: sunit and swidth must be specified together\n");
return -EINVAL; return EINVAL;
} }
if (dsunit && (dswidth % dsunit != 0)) { if (dsunit && (dswidth % dsunit != 0)) {
printk( printk(
"XFS: stripe width (%d) must be a multiple of the stripe unit (%d)\n", "XFS: stripe width (%d) must be a multiple of the stripe unit (%d)\n",
dswidth, dsunit); dswidth, dsunit);
return -EINVAL; return EINVAL;
} }
if ((args->flags & XFSMNT_NOALIGN) != XFSMNT_NOALIGN) { if ((args->flags & XFSMNT_NOALIGN) != XFSMNT_NOALIGN) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment