Re: [PATCH 2/2 V2] btrfs-progs: update generation_v2 in btrfs_update_root

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

 




  	/*
-	* If the btrfs-progs is newer and kernel is at
-	* generation_v1 then we don't touch v2 items
-	* otherwise when kernel is at same or greater
-	* version compared with btrfs-progs then update
-	* the needed
-	*/
-	old_size = btrfs_item_size_nr(l, slot);
-	if (old_size >= sizeof(*item)) {
-		btrfs_set_root_generation_v2(item,
-			btrfs_root_generation(item));
+	 * If this is the first time we update the root item which originated
+	 * from an older kernel, we need to enlarge the item size to make room
+	 * for the added fields.
+	 */
+	if (old_len < sizeof(*item)) {

 With this fix. when kernel is using v1 and btrfs-progs is
 using v2, the disk structure will be changed to v2 after
 running btrfs check. I would rather take a conservative
 approach, by maintaining kernel intended version.

 Thanks, 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