Re: [PATCH v2 2/7] btrfs: return required error from btrfs_check_super_csum

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





@@ -2570,9 +2568,14 @@ int open_ctree(struct super_block *sb,
  	 * We want to check superblock checksum, the type is stored inside.
  	 * Pass the whole disk block of size BTRFS_SUPER_INFO_SIZE (4k).
  	 */
-	if (btrfs_check_super_csum(fs_info, bh->b_data)) {
-		btrfs_err(fs_info, "superblock checksum mismatch");
-		err = -EINVAL;
+	err = btrfs_check_super_csum(bh->b_data);
+	if (err) {
+		if (err == -EINVAL)
+			pr_err("BTRFS error (device %pg): unsupported checksum algorithm",
+				fs_devices->latest_bdev);
+		else
+			pr_err("BTRFS error (device %pg): superblock checksum mismatch",
+				fs_devices->latest_bdev);

nit: I think your initial version of specifically checking for EUCLEAN
was better but I don't have strong preferences.

 Fixed this in v4. Also updated the changelog.

 Thanks for the review.

Anand
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux