diff mbox

rbd: revalidate_disk upon rbd resize

Message ID 1365774766-29899-1-git-send-email-laurent@ksperis.com (mailing list archive)
State New, archived
Headers show

Commit Message

Laurent Barbe April 12, 2013, 1:52 p.m. UTC
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.

Signed-off-by: Laurent Barbe <laurent@ksperis.com>
---
 drivers/block/rbd.c |    1 +
 1 file changed, 1 insertion(+)

Comments

Laurent Barbe April 12, 2013, 1:59 p.m. UTC | #1
Hello,

I have juste move revalidate_disk() in rbd_dev_refresh() outside the mutex.
It seems ok for me.
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Alex Elder April 15, 2013, 5:24 p.m. UTC | #2
On 04/12/2013 08:52 AM, Laurent Barbe wrote:
> 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.
> 
> Signed-off-by: Laurent Barbe <laurent@ksperis.com>

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.

Reviewed-by: Alex Elder <elder@inktank.com>


> ---
>  drivers/block/rbd.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index 4daa400..5f88de9 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -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;
>  }
> 

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Alex Elder April 22, 2013, 5:10 p.m. UTC | #3
On 04/15/2013 12:24 PM, Alex Elder wrote:
> On 04/12/2013 08:52 AM, Laurent Barbe wrote:
>> 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.
>>
>> Signed-off-by: Laurent Barbe <laurent@ksperis.com>
> 
> 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.
> 
> Reviewed-by: Alex Elder <elder@inktank.com>

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

					-Alex


. . .
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sage Weil April 22, 2013, 5:14 p.m. UTC | #4
On Mon, 22 Apr 2013, Alex Elder wrote:
> On 04/15/2013 12:24 PM, Alex Elder wrote:
> > On 04/12/2013 08:52 AM, Laurent Barbe wrote:
> >> 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.
> >>
> >> Signed-off-by: Laurent Barbe <laurent@ksperis.com>
> > 
> > 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.
> > 
> > Reviewed-by: Alex Elder <elder@inktank.com>
> 
> I have committed this to the "testing" branch of the
> ceph-client git repository.

Is this the one that had the lockdep issue?

sage
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Alex Elder April 22, 2013, 5:35 p.m. UTC | #5
On 04/22/2013 12:14 PM, Sage Weil wrote:
> On Mon, 22 Apr 2013, Alex Elder wrote:
>> On 04/15/2013 12:24 PM, Alex Elder wrote:
>>> On 04/12/2013 08:52 AM, Laurent Barbe wrote:
>>>> 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.
>>>>
>>>> Signed-off-by: Laurent Barbe <laurent@ksperis.com>
>>>
>>> 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.
>>>
>>> Reviewed-by: Alex Elder <elder@inktank.com>
>>
>> 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

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 4daa400..5f88de9 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -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;
 }