Re: [PATCH 3/3] dm: Add deleting check to target_message

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

 



Mike Anderson [andmike@xxxxxxxxxxxxxxxxxx] wrote:
> Add dm_table_md_deleting check to target_message
> 
> Signed-off-by: Mike Anderson <andmike@xxxxxxxxxxxxxxxxxx>
> ---
>  drivers/md/dm-ioctl.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
> index a679429..04e252c 100644
> --- a/drivers/md/dm-ioctl.c
> +++ b/drivers/md/dm-ioctl.c
> @@ -1292,6 +1292,11 @@ static int target_message(struct dm_ioctl *param, size_t param_size)
>  	if (!table)
>  		goto out_argv;
> 
> +	if (dm_table_md_deleting(table)) {
> +		r = -ENXIO;
> +		goto out_table;
> +	}

Is there some reason that DELETING bit won't be set while executing the
rest of the following code. If not, what is the point of checking the
bit above?

> 
>  	ti = dm_table_find_target(table, tmsg->sector);
>  	if (!dm_target_is_valid(ti)) {
>  		DMWARN("Target message sector outside device.");
> @@ -1303,6 +1308,7 @@ static int target_message(struct dm_ioctl *param, size_t param_size)
>  		r = -EINVAL;
>  	}
> 
> + out_table:
>  	dm_table_put(table);
>   out_argv:
>  	kfree(argv);
> 
> --
> dm-devel mailing list
> dm-devel@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/dm-devel

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel

[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux