xfs
[Top] [All Lists]

[PATCH] mkfs: don't warn about topology when mkfsing a file

To: xfs-oss <xfs@xxxxxxxxxxx>
Subject: [PATCH] mkfs: don't warn about topology when mkfsing a file
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Mon, 18 Jan 2010 13:21:53 -0600
User-agent: Thunderbird 2.0.0.23 (Macintosh/20090812)
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 <sandeen@xxxxxxxxxxx>
---

diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index 689425d..8896035 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -356,6 +356,10 @@ 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;
+
+       if (!stat(device, &statbuf) && S_ISREG(statbuf.st_mode))
+               return;
 
        pr = blkid_new_probe_from_filename(device);
        if (!pr)

<Prev in Thread] Current Thread [Next in Thread>