Re: [PATCH v5 9/9] btrfs: Use sb_want_write() to protect sysfs feature change.

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

 



On Fri, Jan 30, 2015 at 05:20:54PM +0800, Qu Wenruo wrote:
> --- a/fs/btrfs/sysfs.c
> +++ b/fs/btrfs/sysfs.c
> @@ -154,9 +154,15 @@ static ssize_t btrfs_feature_attr_store(struct kobject *kobj,
>  	btrfs_info(fs_info, "%s %s feature flag",
>  		   val ? "Setting" : "Clearing", fa->kobj_attr.attr.name);
>  
> +	ret = sb_want_write(fs_info->sb);
> +	if (ret)
> +		return ret;

Same here, move it to the beginning, right after fs_info is validated.

> +
>  	trans = btrfs_start_transaction(fs_info->fs_root, 0);
> -	if (IS_ERR(trans))
> -		return PTR_ERR(trans);
> +	if (IS_ERR(trans)) {
> +		ret = PTR_ERR(trans);
> +		goto out;
> +	}
>  
--
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