Re: [PATCH] Btrfs: check to see if root_list is empty before adding it to dead roots

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

 



> -int btrfs_add_dead_root(struct btrfs_root *root)
> +void btrfs_add_dead_root(struct btrfs_root *root)
>  {
>  	spin_lock(&root->fs_info->trans_lock);
> -	list_add_tail(&root->root_list, &root->fs_info->dead_roots);
> +	if (list_empty(&root->root_list))
> +		list_add_tail(&root->root_list, &root->fs_info->dead_roots);
>  	spin_unlock(&root->fs_info->trans_lock);
> -	return 0;
>  }
>  
>  /*
> @@ -1925,7 +1925,7 @@ int btrfs_clean_one_deleted_snapshot(struct btrfs_root *root)
>  	}
>  	root = list_first_entry(&fs_info->dead_roots,
>  			struct btrfs_root, root_list);
> -	list_del(&root->root_list);
> +	list_del_init(&root->root_list);

Looking at other root_list deletions.. do we also need _del_init() in
btrfs_recover_relocation() or del_fs_roots()?  (Maybe for consistency
and peace of mind, if nothing else?)

- z
--
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