Module Name: src Committed By: brad Date: Fri Aug 30 23:41:48 UTC 2019
Modified Files: src/usr.sbin/puffs/rump_lfs: rump_lfs.c Log Message: The cleaner is compiled into rump_lfs and executed as a thread. Pass in the raw device using the new -J option. This avoids the use of getdiskrawname which is not particularly rump safe in this context and insures that the rump container device is used for cleaning, not the outer device. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/puffs/rump_lfs/rump_lfs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.sbin/puffs/rump_lfs/rump_lfs.c diff -u src/usr.sbin/puffs/rump_lfs/rump_lfs.c:1.18 src/usr.sbin/puffs/rump_lfs/rump_lfs.c:1.19 --- src/usr.sbin/puffs/rump_lfs/rump_lfs.c:1.18 Sun Aug 2 18:11:57 2015 +++ src/usr.sbin/puffs/rump_lfs/rump_lfs.c Fri Aug 30 23:41:48 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: rump_lfs.c,v 1.18 2015/08/02 18:11:57 dholland Exp $ */ +/* $NetBSD: rump_lfs.c,v 1.19 2019/08/30 23:41:48 brad Exp $ */ /* * Copyright (c) 2008 Antti Kantee. All Rights Reserved. @@ -43,16 +43,20 @@ #include "mount_lfs.h" +#define RUMPRAWDEVICE "/dev/rrumpy0" + static void * cleaner(void *arg) { - const char *the_argv[7]; + const char *the_argv[9]; the_argv[0] = "megamaid"; the_argv[1] = "-D"; /* don't fork() & detach */ - the_argv[2] = arg; + the_argv[2] = "-J"; /* treat arg as a device */ + the_argv[3] = RUMPRAWDEVICE; + the_argv[4] = arg; - lfs_cleaner_main(3, __UNCONST(the_argv)); + lfs_cleaner_main(5, __UNCONST(the_argv)); return NULL; } @@ -93,7 +97,7 @@ main(int argc, char *argv[]) * XXX: this particular piece inspired by the cleaner code. * obviously FIXXXME along with the cleaner. */ - sprintf(rawdev, "/dev/r%s", canon_dev+5); + strlcpy(rawdev, RUMPRAWDEVICE, MAXPATHLEN); rump_pub_etfs_register(rawdev, canon_dev, RUMP_ETFS_CHR); /*