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@xxxxxxxxxxx> >> --- >> 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@xxxxxxxxxxx> > >> - >> - rc = rbd_dev_image_probe(rbd_dev); >> + rc = rbd_dev_image_probe(rbd_dev, read_only); >> if (rc < 0) >> goto err_out_rbd_dev; >> > -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html