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

Re: [dm-devel] Re: [RFC 3/3] dm: v4 ioctl interface



On Wednesday 02 July 2003 06:00, Joe Thornber wrote:
> dm_swap_table() will now fail for a table with no targets.
> --- diff/drivers/md/dm.c           2003-07-01 15:36:42.000000000 +0100
> +++ source/drivers/md/dm.c         2003-07-02 11:53:22.000000000 +0100
> @@ -664,10 +664,10 @@
>            md->map = t;
>
>            size = dm_table_get_size(t);
> -          set_capacity(md->disk, size);
> -          if (size == 0)
> -                      return 0;
> +          if (!size)
> +                      return -EINVAL;
>
> +          set_capacity(md->disk, size);
>            dm_table_event_callback(md->map, event_callback, md);
>
>            dm_table_get(t);
> @@ -759,8 +759,10 @@
>
>            __unbind(md);
>            r = __bind(md, table);
> -          if (r)
> +          if (r) {
> +                      up_write(&md->lock);
>                        return r;
> +          }
>
>            up_write(&md->lock);
>            return 0;

Why the "if (r)"?  Isn't this just the same as:

            __unbind(md);
            r = __bind(md, table);
            up_write(&md->lock);
            return r;

--
Steve Dobbelstein
steved us ibm com
http://evms.sourceforge.net/






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