public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] xfsprogs: repair never return if device removed
@ 2011-01-28 11:31 Ajeet Yadav
  2011-01-31  2:41 ` Ajeet Yadav
  0 siblings, 1 reply; 5+ messages in thread
From: Ajeet Yadav @ 2011-01-28 11:31 UTC (permalink / raw)
  To: xfs


[-- Attachment #1.1: Type: text/plain, Size: 321 bytes --]

xfsprogs all version, delete primary superblock of xfs partition

dd if=/dev/zero of=/dev/sda1 bs=512 count=1
sync

Run xfs_repair in partition, while its searching for secondary superblock,
remove the disk (USB) xfs_repair will never exit and will loop in never
ending ............

Please find patch attached with mail

[-- Attachment #1.2: Type: text/html, Size: 420 bytes --]

[-- Attachment #2: xfs_repair_hang_on_device_removal.patch --]
[-- Type: application/octet-stream, Size: 517 bytes --]

diff -Nurp xfsprogs-3.0.5/repair/sb.c xfsprogs-3.0.5-dirty/repair/sb.c
--- xfsprogs-3.0.5/repair/sb.c	2011-01-28 20:23:02.000000000 +0900
+++ xfsprogs-3.0.5-dirty/repair/sb.c	2011-01-28 20:21:06.000000000 +0900
@@ -122,8 +122,9 @@ find_secondary_sb(xfs_sb_t *rsb)
 			done = 1;
 		}
 
-		if (!done && (bsize = read(x.dfd, sb, BSIZE)) == 0)  {
+		if (!done && (bsize = read(x.dfd, sb, BSIZE)) <= 0)  {
 			done = 1;
+			do_warn(_("Couldn't find candidate secondary superblock, exiting...\n"));
 		}
 
 		do_warn(".");

[-- Attachment #3: Type: text/plain, Size: 121 bytes --]

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

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

end of thread, other threads:[~2011-02-01 21:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-28 11:31 [patch] xfsprogs: repair never return if device removed Ajeet Yadav
2011-01-31  2:41 ` Ajeet Yadav
2011-02-01  7:08   ` Ajeet Yadav
2011-02-01 21:39     ` Christoph Hellwig
2011-02-01 21:14   ` Christoph Hellwig

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