public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mkfs: fix mkfs.xfs -dfile,name=$NAME for new files
@ 2010-01-14 21:53 Eric Sandeen
  2010-01-15 18:01 ` Alex Elder
  2010-01-15 18:47 ` [PATCH V2] " Eric Sandeen
  0 siblings, 2 replies; 5+ messages in thread
From: Eric Sandeen @ 2010-01-14 21:53 UTC (permalink / raw)
  To: xfs mailing list

# /sbin/mkfs.xfs -dfile,name=grrr,size=100g
mkfs.xfs: Use the -f option to force overwrite.

check_overwrite is failing, because  blkid_new_probe_from_filename()
is failing, because the (new) image file is 0 length.

We already return 0 (carry on!) for other internal failures,
and nobody tests for a -1 return.  So let's just let this
one pass too.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---

(note, i'm open to comments if we want to differentiate
1/0/-1 in a cleaner fashion...)

diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index 9a8eff3..53568bc 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -296,7 +296,7 @@ check_overwrite(
 
 	pr = blkid_new_probe_from_filename(device);
 	if (!pr)
-		return -1;
+		return 0;
 
 	if (blkid_probe_enable_partitions(pr, 1))
 		goto out_free_probe;

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-01-15 22:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-14 21:53 [PATCH] mkfs: fix mkfs.xfs -dfile,name=$NAME for new files Eric Sandeen
2010-01-15 18:01 ` Alex Elder
2010-01-15 18:47 ` [PATCH V2] " Eric Sandeen
2010-01-15 19:11   ` Alex Elder
2010-01-15 22:44     ` Eric Sandeen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox