svn commit: r183947 - in user/netchild/misc/src/sys/gnu/fs: ext2fs
reiserfs
Alexander Leidinger
netchild at FreeBSD.org
Thu Oct 16 10:47:39 UTC 2008
Author: netchild
Date: Thu Oct 16 10:47:39 2008
New Revision: 183947
URL: http://svn.freebsd.org/changeset/base/183947
Log:
Some more error checking. XXX: Too much defensive programming?
Modified:
user/netchild/misc/src/sys/gnu/fs/ext2fs/ext2_vfsops.c
user/netchild/misc/src/sys/gnu/fs/reiserfs/reiserfs_vfsops.c
Modified: user/netchild/misc/src/sys/gnu/fs/ext2fs/ext2_vfsops.c
==============================================================================
--- user/netchild/misc/src/sys/gnu/fs/ext2fs/ext2_vfsops.c Thu Oct 16 10:45:39 2008 (r183946)
+++ user/netchild/misc/src/sys/gnu/fs/ext2fs/ext2_vfsops.c Thu Oct 16 10:47:39 2008 (r183947)
@@ -145,7 +145,10 @@ ext2_mount(mp, td)
if (vfs_filteropt(opts, ext2_opts))
return (EINVAL);
- vfs_getopt(opts, "fspath", (void **)&path, NULL);
+ /* The fspath has to exist (invariant), but better safe than sorry. */
+ error = vfs_getopt(opts, "fspath", (void **)&path, NULL);
+ if (error != 0)
+ return (error);
/* Double-check the length of path.. */
if (strlen(path) >= MAXMNTLEN - 1)
return (ENAMETOOLONG);
Modified: user/netchild/misc/src/sys/gnu/fs/reiserfs/reiserfs_vfsops.c
==============================================================================
--- user/netchild/misc/src/sys/gnu/fs/reiserfs/reiserfs_vfsops.c Thu Oct 16 10:45:39 2008 (r183946)
+++ user/netchild/misc/src/sys/gnu/fs/reiserfs/reiserfs_vfsops.c Thu Oct 16 10:47:39 2008 (r183947)
@@ -89,8 +89,10 @@ reiserfs_mount(struct mount *mp, struct
opts = mp->mnt_optnew;
/* `fspath' contains the mount point (eg. /mnt/linux); REQUIRED */
- vfs_getopt(opts, "fspath", (void **)&path, NULL);
- reiserfs_log(LOG_INFO, "mount point is `%s'\n", path);
+ if (vfs_getopt(opts, "fspath", (void **)&path, NULL) == 0)
+ reiserfs_log(LOG_INFO, "mount point is `%s'\n", path);
+ else
+ reiserfs_log(LOG_WARNING, "mount point is `<unknown>'\n");
/* `from' contains the device name (eg. /dev/ad0s1); REQUIRED */
fspec = NULL;
More information about the svn-src-user
mailing list