summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorrodrigc <rodrigc@FreeBSD.org>2009-01-28 07:46:35 +0000
committerrodrigc <rodrigc@FreeBSD.org>2009-01-28 07:46:35 +0000
commit89c6c71f34fb4e759767d6f0d4a293a922f09bb5 (patch)
tree2319b97ed0f2b3ba9cbd9e4b51fa5e8c267385de /sys
parentc332936c10b8bc74ce794cf8b9705b27ed54d4fb (diff)
downloadFreeBSD-src-89c6c71f34fb4e759767d6f0d4a293a922f09bb5.zip
FreeBSD-src-89c6c71f34fb4e759767d6f0d4a293a922f09bb5.tar.gz
Fix parsing of acregmin, acregmax, acdirmin and acdirmax NFS mount options
when passed as strings via nmount(). Submitted by: Jaakko Heinonen <jh saunalahti fi>
Diffstat (limited to 'sys')
-rw-r--r--sys/nfsclient/nfs_vfsops.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c
index 00332f0..9118d30 100644
--- a/sys/nfsclient/nfs_vfsops.c
+++ b/sys/nfsclient/nfs_vfsops.c
@@ -976,39 +976,43 @@ nfs_mount(struct mount *mp, struct thread *td)
}
if (vfs_getopt(mp->mnt_optnew, "acregmin", (void **)&opt, NULL) == 0) {
ret = sscanf(opt, "%d", &args.acregmin);
- if (ret != 1 || args.acregmin <= 0) {
+ if (ret != 1 || args.acregmin < 0) {
vfs_mount_error(mp, "illegal acregmin: %s",
opt);
error = EINVAL;
goto out;
}
+ args.flags |= NFSMNT_ACREGMIN;
}
if (vfs_getopt(mp->mnt_optnew, "acregmax", (void **)&opt, NULL) == 0) {
ret = sscanf(opt, "%d", &args.acregmax);
- if (ret != 1 || args.acregmax <= 0) {
+ if (ret != 1 || args.acregmax < 0) {
vfs_mount_error(mp, "illegal acregmax: %s",
opt);
error = EINVAL;
goto out;
}
+ args.flags |= NFSMNT_ACREGMAX;
}
if (vfs_getopt(mp->mnt_optnew, "acdirmin", (void **)&opt, NULL) == 0) {
ret = sscanf(opt, "%d", &args.acdirmin);
- if (ret != 1 || args.acdirmin <= 0) {
+ if (ret != 1 || args.acdirmin < 0) {
vfs_mount_error(mp, "illegal acdirmin: %s",
opt);
error = EINVAL;
goto out;
}
+ args.flags |= NFSMNT_ACDIRMIN;
}
if (vfs_getopt(mp->mnt_optnew, "acdirmax", (void **)&opt, NULL) == 0) {
ret = sscanf(opt, "%d", &args.acdirmax);
- if (ret != 1 || args.acdirmax <= 0) {
+ if (ret != 1 || args.acdirmax < 0) {
vfs_mount_error(mp, "illegal acdirmax: %s",
opt);
error = EINVAL;
goto out;
}
+ args.flags |= NFSMNT_ACDIRMAX;
}
if (vfs_getopt(mp->mnt_optnew, "deadthresh", (void **)&opt, NULL) == 0) {
ret = sscanf(opt, "%d", &args.deadthresh);
OpenPOWER on IntegriCloud