/* - * 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 majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html