Skip to contentSkip to conversation

rbd: revalidate_disk upon rbd resize

PATCH In review Laurent Barbe 3 participants 6 messages Apr 12, 2013 – Apr 22, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rbd: revalidate_disk upon rbd resize

If rbd disk is open and rbd resize is done, new size is not visible by filesystem.
Like is done in virtio-blk and dm driver, revalidate_disk() permits to update the bd_inode size.

---
 drivers/block/rbd.c |    1 +
 1 file changed, 1 insertion(+)
drivers/block/rbd.c +1 -0
index 4daa400..5f88de9 100644
@@ -1883,6 +1883,7 @@ static int rbd_dev_refresh(struct rbd_device *rbd_dev, u64 *hver)
 	else
 		ret = rbd_dev_v2_refresh(rbd_dev, hver);
 	mutex_unlock(&ctl_mutex);
+	revalidate_disk(rbd_dev->disk);
 
 	return ret;
 }
Signature · 1 line
1.7.10.4
#1 lore raw

Hello,

I have juste move revalidate_disk() in rbd_dev_refresh() outside the mutex. It seems ok for me.

Reviewed-by on v1 1/1
#2 lore raw
In reply to Laurent Barbe
Quoted 6 lines · Laurent Barbe

If rbd disk is open and rbd resize is done, new size is not visible by filesystem.
Like is done in virtio-blk and dm driver, revalidate_disk() permits to update the bd_inode size.

This one looks good (too). And this time I've tested it just to be sure I get no lockdep warnings. Unless I see any strangeness in my sanity testing (which I don't expect) I'll commit this to the testing branch later today. Thanks a lot.

Quoted 17 lines
---
 drivers/block/rbd.c |    1 +
 1 file changed, 1 insertion(+)
drivers/block/rbd.c +1 -0
index 4daa400..5f88de9 100644
@@ -1883,6 +1883,7 @@ static int rbd_dev_refresh(struct rbd_device *rbd_dev, u64 *hver)
 	else
 		ret = rbd_dev_v2_refresh(rbd_dev, hver);
 	mutex_unlock(&ctl_mutex);
+	revalidate_disk(rbd_dev->disk);
 
 	return ret;
 }
#3 lore raw
Quoted 8 lines · Alex Elder
Quoted 6 lines · Laurent Barbe

If rbd disk is open and rbd resize is done, new size is not visible by filesystem.
Like is done in virtio-blk and dm driver, revalidate_disk() permits to update the bd_inode size.

Quoted 7 lines

This one looks good (too). And this time I've tested it just to be sure I get no lockdep warnings. Unless I see any strangeness in my sanity testing (which I don't expect) I'll commit this to the testing branch later today. Thanks a lot.

I have committed this to the "testing" branch of the ceph-client git repository.

-Alex

. . .

#4 lore raw
Quoted 15 lines · Alex Elder
Quoted 14 lines · Alex Elder
Quoted 6 lines · Laurent Barbe

If rbd disk is open and rbd resize is done, new size is not visible by filesystem.
Like is done in virtio-blk and dm driver, revalidate_disk() permits to update the bd_inode size.

This one looks good (too). And this time I've tested it just to be sure I get no lockdep warnings. Unless I see any strangeness in my sanity testing (which I don't expect) I'll commit this to the testing branch later today. Thanks a lot.

Quoted 4 lines
Quoted 1 line

I have committed this to the "testing" branch of the ceph-client git repository.

Is this the one that had the lockdep issue?

sage

#5 lore raw
Quoted 16 lines · Sage Weil
Quoted 15 lines · Alex Elder
Quoted 14 lines · Alex Elder
Quoted 6 lines · Laurent Barbe

If rbd disk is open and rbd resize is done, new size is not visible by filesystem.
Like is done in virtio-blk and dm driver, revalidate_disk() permits to update the bd_inode size.

This one looks good (too). And this time I've tested it just to be sure I get no lockdep warnings. Unless I see any strangeness in my sanity testing (which I don't expect) I'll commit this to the testing branch later today. Thanks a lot.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

I have committed this to the "testing" branch of the ceph-client git repository.

Is this the one that had the lockdep issue?

It did, but moving where it got called (into
rbd_dev_refresh(), outside the control mutex)
resolved that.

-Alex