Skip to contentSkip to conversation

xfs_mkfs: Do not discard if '-N' is provided

PATCH Applied Lukas Czerner 2 participants 2 messages Feb 12, 2013 – Feb 14, 2013

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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.

---
v2: Rebase to the up-to-date repository

 mkfs/xfs_mkfs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
mkfs/xfs_mkfs.c +1 -1
index 3cfab06..c84448e 100644
@@ -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);
Signature · 6 lines
1.7.7.6

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by on v2 1/1 Applied
#1 lore raw
Quoted 7 lines · Lukas Czerner

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.

Wow. That's bad.

Applied. Thanks Lukas!

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs