Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 331663
b: refs/heads/master
c: 4bb1f1e
h: refs/heads/master
i:
  331661: a246621
  331659: d115ced
  331655: b4fa13f
  331647: e201068
v: v3
  • Loading branch information
Alex Elder committed Oct 1, 2012
1 parent de6849a commit e7d3c35
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1fcdb8aa1f58af72eb8206ba97fab2df77df2b14
refs/heads/master: 4bb1f1ed0063870f34ae5783cda08924964bac0b
5 changes: 2 additions & 3 deletions trunk/drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -647,8 +647,6 @@ static int rbd_header_set_snap(struct rbd_device *rbd_dev, char *snap_name)
{
int ret;

down_write(&rbd_dev->header_rwsem);

if (!memcmp(snap_name, RBD_SNAP_HEAD_NAME,
sizeof (RBD_SNAP_HEAD_NAME))) {
rbd_dev->mapping.snap_id = CEPH_NOSNAP;
Expand All @@ -666,7 +664,6 @@ static int rbd_header_set_snap(struct rbd_device *rbd_dev, char *snap_name)

ret = 0;
done:
up_write(&rbd_dev->header_rwsem);
return ret;
}

Expand Down Expand Up @@ -2608,7 +2605,9 @@ static ssize_t rbd_add(struct bus_type *bus,
if (rc)
goto err_out_bus;

down_write(&rbd_dev->header_rwsem);
rc = rbd_header_set_snap(rbd_dev, snap_name);
up_write(&rbd_dev->header_rwsem);
if (rc)
goto err_out_bus;

Expand Down

0 comments on commit e7d3c35

Please sign in to comment.