On Thu, Jul 24, 2014 at 11:37:07AM +0800, Miao Xie wrote:
> We should not write data into a readonly device especially seed device when
> doing scrub, skip those devices.
>
> Signed-off-by: Miao Xie <miaox@xxxxxxxxxxxxxx>
Reviewed-by: David Sterba <dsterba@xxxxxxx>
One minor comment below.
> @@ -2904,6 +2904,7 @@ int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start,
> struct scrub_ctx *sctx;
> int ret;
> struct btrfs_device *dev;
> + struct rcu_string *name;
>
> + if (!is_dev_replace && !readonly && !dev->writeable) {
You can define 'name' within the block.
> + mutex_unlock(&fs_info->fs_devices->device_list_mutex);
> + rcu_read_lock();
> + name = rcu_dereference(dev->name);
> + btrfs_err(fs_info, "scrub: device %s is not writable",
> + name->str);
> + rcu_read_unlock();
> + return -EROFS;
> + }
--
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