git: sbin/newfs_hammer: Don't assume blkdev is /dev/da...
tkusumi at crater.dragonflybsd.org
Thu Jul 14 10:45:18 PDT 2016
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date: Fri Jul 15 00:17:41 2016 +0900
sbin/newfs_hammer: Don't assume blkdev is /dev/da...
newfs_hammer has "/dev/da..." hardcoded in its TRIM support,
as TRIM sysctls exist only for physical disks.
newfs_hammer should detect non physical block devices such as
device mapper or loopback devices, before it calls sysctl(3),
so as not to print an error message like below.
# newfs_hammer -E -L TEST /dev/mapper/linear1
Volume 0 DEVICE /dev/mapper/linear1 size 465.66TB
DEVICE /dev/mapper/linear1 (kern.cam.da.pper/linear1.trim_enabled) does not support the TRIM command
usage: newfs_hammer -L label [-Ef] [-b bootsize] [-m savesize] [-u undosize]
[-V version] special ...
Summary of changes:
sbin/newfs_hammer/newfs_hammer.c | 7 +++++++
1 file changed, 7 insertions(+)
DragonFly BSD source repository
More information about the Commits