Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176569
b: refs/heads/master
c: 615d1eb
h: refs/heads/master
i:
  176567: 60baedf
v: v3
  • Loading branch information
Mike Snitzer authored and Alasdair G Kergon committed Dec 10, 2009
1 parent 2a6a5d3 commit 44d0f13
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 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: 9eaae8ffbc340fc034fed1e5d0dc9ca0e943f817
refs/heads/master: 615d1eb9cad9b34ed17c18c604254e8db533ac6f
18 changes: 12 additions & 6 deletions trunk/drivers/md/dm-snap.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,16 @@ static int __chunk_is_tracked(struct dm_snapshot *s, chunk_t chunk)
return found;
}

/*
* This conflicting I/O is extremely improbable in the caller,
* so msleep(1) is sufficient and there is no need for a wait queue.
*/
static void __check_for_conflicting_io(struct dm_snapshot *s, chunk_t chunk)
{
while (__chunk_is_tracked(s, chunk))
msleep(1);
}

/*
* One of these per registered origin, held in the snapshot_origins hash
*/
Expand Down Expand Up @@ -1102,12 +1112,8 @@ static void pending_complete(struct dm_snap_pending_exception *pe, int success)
goto out;
}

/*
* Check for conflicting reads. This is extremely improbable,
* so msleep(1) is sufficient and there is no need for a wait queue.
*/
while (__chunk_is_tracked(s, pe->e.old_chunk))
msleep(1);
/* Check for conflicting reads */
__check_for_conflicting_io(s, pe->e.old_chunk);

/*
* Add a proper exception, and remove the
Expand Down

0 comments on commit 44d0f13

Please sign in to comment.