From: Eric Sandeen Date: Tue, 19 Jan 2010 16:52:44 +0000 (-0600) Subject: mkfs: don't warn about topology when mkfsing a file X-Git-Tag: v3.1.1~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb10fd960b3c81a3f09993ae84626fbee018a33f;p=thirdparty%2Fxfsprogs-dev.git mkfs: don't warn about topology when mkfsing a file Some tests were failing for me like: QA output created by 206 === truncate file === === mkfs.xfs === +warning: unable to probe device toplology for device /mnt/test/fsfile.21615 ... I thought about filtering the tests, but ... It seems that we shouldn't even be trying to get topology for a plain file, should we? And then we won't warn about failure. Signed-off-by: Eric Sandeen Reviewed-by: Dave Chinner Signed-off-by: Christoph Hellwig --- diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 689425dfa..b672b7a4d 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -356,6 +356,11 @@ static void blkid_get_topology(const char *device, int *sunit, int *swidth, int blkid_topology tp; blkid_probe pr; unsigned long val; + struct stat statbuf; + + /* can't get topology info from a file */ + if (!stat(device, &statbuf) && S_ISREG(statbuf.st_mode)) + return; pr = blkid_new_probe_from_filename(device); if (!pr)