mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
rbd: protect read of snapshot sequence number
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 <[email protected]> Reviewed-by: Alex Elder <[email protected]> Reviewed-by: Yehuda Sadeh <[email protected]>
This commit is contained in:
parent
50f7c4c967
commit
403f24d3d5
1 changed files with 3 additions and 1 deletions
|
|
@ -1684,7 +1684,9 @@ static int rbd_header_add_snap(struct rbd_device *dev,
|
|||
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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue