Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/puffs/rump_lfs The cleaner is compiled into rump_lf...



details:   https://anonhg.NetBSD.org/src/rev/18cf323bd602
branches:  trunk
changeset: 844696:18cf323bd602
user:      brad <brad%NetBSD.org@localhost>
date:      Fri Aug 30 23:41:48 2019 +0000

description:
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.

diffstat:

 usr.sbin/puffs/rump_lfs/rump_lfs.c |  14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diffs (42 lines):

diff -r ecd2babb1ead -r 18cf323bd602 usr.sbin/puffs/rump_lfs/rump_lfs.c
--- a/usr.sbin/puffs/rump_lfs/rump_lfs.c        Fri Aug 30 23:37:23 2019 +0000
+++ b/usr.sbin/puffs/rump_lfs/rump_lfs.c        Fri Aug 30 23:41:48 2019 +0000
@@ -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 @@
         * 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);
 
        /*



Home | Main Index | Thread Index | Old Index