mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
rbd: only reset capacity when pointing to head
Snapshots cannot be resized, and the new capacity of head should not be reflected by the snapshot. Signed-off-by: Josh Durgin <[email protected]> Reviewed-by: Alex Elder <[email protected]>
This commit is contained in:
parent
e88a36ec96
commit
474ef7ce83
1 changed files with 6 additions and 1 deletions
|
|
@ -1725,7 +1725,12 @@ static int __rbd_refresh_header(struct rbd_device *rbd_dev)
|
|||
return ret;
|
||||
|
||||
/* resized? */
|
||||
set_capacity(rbd_dev->disk, h.image_size / SECTOR_SIZE);
|
||||
if (rbd_dev->snap_id == CEPH_NOSNAP) {
|
||||
sector_t size = (sector_t) h.image_size / SECTOR_SIZE;
|
||||
|
||||
dout("setting size to %llu sectors", (unsigned long long) size);
|
||||
set_capacity(rbd_dev->disk, size);
|
||||
}
|
||||
|
||||
down_write(&rbd_dev->header_rwsem);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue