Skip to contentSkip to conversation

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

PATCH In review Eric Sandeen 3 participants 3 messages Jan 18, 2010 – Jan 19, 2010

lore
Share & tools
lore
#0 lore raw

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

---

mkfs/xfs_mkfs.c +4 -0
index 689425d..8896035 100644
@@ -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)

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

Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Eric Sandeen

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
...

Quoted 7 lines

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.

Sound pretty sane to me.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#2 lore raw
In reply to Eric Sandeen
Quoted 8 lines · Eric Sandeen

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
...

Quoted 4 lines

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.

Looks good to me. Would be even nicer if libblkid handled that case, but let's fix it where we can easily do it.

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