From: Eric Sandeen <sandeen@sandeen.net>
To: xfs mailing list <xfs@oss.sgi.com>
Subject: [PATCH] mkfs: fix mkfs.xfs -dfile,name=$NAME for new files
Date: Thu, 14 Jan 2010 15:53:52 -0600 [thread overview]
Message-ID: <4B4F9270.4070006@sandeen.net> (raw)
# /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
next reply other threads:[~2010-01-14 21:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-14 21:53 Eric Sandeen [this message]
2010-01-15 18:01 ` [PATCH] mkfs: fix mkfs.xfs -dfile,name=$NAME for new files 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B4F9270.4070006@sandeen.net \
--to=sandeen@sandeen.net \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox