From: Lukas Czerner Date: Tue, 12 Feb 2013 15:44:30 +0000 (+0100) Subject: xfs_mkfs: Do not discard if '-N' is provided X-Git-Tag: v3.1.11~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de0918e62deb343f3101fe5eb8ea9579405f0792;p=thirdparty%2Fxfsprogs-dev.git xfs_mkfs: Do not discard if '-N' is provided When '-N' is specified we really should not write anything to the device, neither we should attempt to discard the device. This commit fixes xfs_mkfs to not attempt to discard the device in the case user specified '-N' flag. Signed-off-by: Lukas Czerner Reviewed-by: Ben Myers Signed-off-by: Ben Myers --- diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 3cfab0649..c84448ecb 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -1950,7 +1950,7 @@ _("block size %d cannot be smaller than logical sector size %d\n"), } } - if (discard) { + if (discard && !Nflag) { discard_blocks(xi.ddev, xi.dsize); if (xi.rtdev) discard_blocks(xi.rtdev, xi.rtsize);