From: Alex Elder <elder@inktank.com>
To: Josh Durgin <josh.durgin@inktank.com>
Cc: ceph-devel@vger.kernel.org
Subject: Re: [PATCH 6/6] rbd: always set read-only flag in rbd_add()
Date: Wed, 08 May 2013 07:50:27 -0500 [thread overview]
Message-ID: <518A4A13.60806@inktank.com> (raw)
In-Reply-To: <51898577.7040509@inktank.com>
On 05/07/2013 05:51 PM, Josh Durgin wrote:
> On 05/06/2013 06:38 PM, Alex Elder wrote:
>> Hold off setting the read-only flag in rbd_add() for an image being
>> mapped until we have successfully probed the image. At that point
>> we know whether it's a snapshot mapping or not, so we can set the
>> read-only flag in that one place rather than doing so (for
>> snapshots) in rbd_dev_mapping_set(). To do this, pass a flag to the
>> image probe routine indicating whether we want a read-only mapping.
>>
>> Signed-off-by: Alex Elder <elder@inktank.com>
>> ---
>> drivers/block/rbd.c | 28 ++++++++++++++--------------
>> 1 file changed, 14 insertions(+), 14 deletions(-)
>>
>> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
>> index 530793a..0c72643 100644
>> --- a/drivers/block/rbd.c
>> +++ b/drivers/block/rbd.c
. . .
>> @@ -4850,11 +4854,7 @@ static ssize_t rbd_add(struct bus_type *bus,
>> rbdc = NULL; /* rbd_dev now owns this */
>> spec = NULL; /* rbd_dev now owns this */
>>
>> - rbd_dev->mapping.read_only = rbd_opts->read_only;
>> - kfree(rbd_opts);
>> - rbd_opts = NULL; /* done with this */
>
> It looks like this was moved accidentally? Maybe needed
> by a later patch?
No, I changed to grabbing the read-only flag in a local
variable, and as long as I was doing that I moved it
up right after argument parsing so I could free the
options structure right away.
-Alex
> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
>
>> -
>> - rc = rbd_dev_image_probe(rbd_dev);
>> + rc = rbd_dev_image_probe(rbd_dev, read_only);
>> if (rc < 0)
>> goto err_out_rbd_dev;
>>
>
prev parent reply other threads:[~2013-05-08 12:50 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-07 1:36 [PATCH 0/6] rbd: miscellaneous cleanups Alex Elder
2013-05-07 1:37 ` [PATCH 1/6] rbd: update capacity in rbd_dev_refresh() Alex Elder
2013-05-07 22:49 ` Josh Durgin
2013-05-07 1:37 ` [PATCH 2/6] rbd: kill rbd_update_mapping_size() Alex Elder
2013-05-07 14:56 ` Josh Durgin
2013-05-07 15:41 ` Alex Elder
2013-05-07 1:37 ` [PATCH 3/6] rbd: don't print warning if not mapping a parent Alex Elder
2013-05-07 14:21 ` Josh Durgin
2013-05-07 1:38 ` [PATCH 4/6] rbd: don't look up snapshot id in rbd_dev_mapping_set() Alex Elder
2013-05-07 14:26 ` Josh Durgin
2013-05-07 1:38 ` [PATCH 5/6] rbd: kill rbd_dev_clear_mapping() Alex Elder
2013-05-07 14:26 ` Josh Durgin
2013-05-07 1:38 ` [PATCH 6/6] rbd: always set read-only flag in rbd_add() Alex Elder
2013-05-07 22:51 ` Josh Durgin
2013-05-08 12:50 ` Alex Elder [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=518A4A13.60806@inktank.com \
--to=elder@inktank.com \
--cc=ceph-devel@vger.kernel.org \
--cc=josh.durgin@inktank.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox