Re: [PATCH 1/6] rbd: protect read of snapshot sequence number

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

 



On Wed, Apr 18, 2012 at 7:40 AM, Alex Elder <elder@xxxxxxxxxxxxx> wrote:
> This is updated whenever a snapshot is added or deleted, and the
> snapc pointer is changed with every refresh of the header.
>
> Signed-off-by: Josh Durgin <josh.durgin@xxxxxxxxxxxxx>
> Reviewed-by: Alex Elder <elder@xxxxxxxxxxxxx>
> ---
>  drivers/block/rbd.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> Index: b/drivers/block/rbd.c
> ===================================================================
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -1685,7 +1685,9 @@
>        if (ret < 0)
>                return ret;
>
> -       dev->header.snapc->seq =  new_snapid;
> +       down_write(&dev->header_rwsem);
> +       dev->header.snapc->seq = new_snapid;
> +       up_write(&dev->header_rwsem);
>
>        return 0;
>  bad:

Reviewed-by: Yehuda Sadeh <yehuda@xxxxxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux