Skip to contentSkip to conversation

btrfs-progs: fix btrfs_read_dev_super

PATCH New Edward Shishkin 1 participant 1 message May 27, 2009 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs-progs: fix btrfs_read_dev_super

Don't break in the middle of search,
taste also other super mirrors.

---
 disk-io.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
disk-io.c +1 -1
@@ -716,7 +716,7 @@ int btrfs_read_dev_super(int fd, struct 
 		bytenr = btrfs_sb_offset(i);
 		ret = pread64(fd, &buf, sizeof(buf), bytenr);
 		if (ret < sizeof(buf))
-			break;
+			continue;
 
 		if (btrfs_super_bytenr(&buf) != bytenr ||
 		    strncmp((char *)(&buf.magic), BTRFS_MAGIC,