From owner-svn-src-head@freebsd.org Wed Sep 23 21:08:53 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F4D6A085BC; Wed, 23 Sep 2015 21:08:53 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 411EE1882; Wed, 23 Sep 2015 21:08:53 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8NL8rZc041894; Wed, 23 Sep 2015 21:08:53 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8NL8rac041893; Wed, 23 Sep 2015 21:08:53 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201509232108.t8NL8rac041893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 23 Sep 2015 21:08:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r288153 - head/sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2015 21:08:53 -0000 Author: cem Date: Wed Sep 23 21:08:52 2015 New Revision: 288153 URL: https://svnweb.freebsd.org/changeset/base/288153 Log: geom_dev: Use kenv 'dumpdev' in the same way as rc/etc.d/dumpon Skip a /dev/ prefix, if one is present, when checking for matching device names for dump. Suggested by: avg Reviewed by: markj Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D3725 Modified: head/sys/geom/geom_dev.c Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Wed Sep 23 20:46:23 2015 (r288152) +++ head/sys/geom/geom_dev.c Wed Sep 23 21:08:52 2015 (r288153) @@ -124,6 +124,7 @@ g_dev_fini(struct g_class *mp) { freeenv(dumpdev); + dumpdev = NULL; } static int @@ -152,10 +153,16 @@ g_dev_setdumpdev(struct cdev *dev, struc static void init_dumpdev(struct cdev *dev) { + const char *devprefix = "/dev/", *devname; + size_t len; if (dumpdev == NULL) return; - if (strcmp(devtoname(dev), dumpdev) != 0) + len = strlen(devprefix); + devname = devtoname(dev); + if (strcmp(devname, dumpdev) != 0 && + (strncmp(dumpdev, devprefix, len) != 0 || + strcmp(devname, dumpdev + len) != 0)) return; if (g_dev_setdumpdev(dev, curthread) == 0) { freeenv(dumpdev);