Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38095
b: refs/heads/master
c: 695368a
h: refs/heads/master
i:
  38093: 19c816d
  38091: eb15ce7
  38087: 6ea0a31
  38079: e5482c7
v: v3
  • Loading branch information
Alasdair G Kergon authored and Linus Torvalds committed Oct 3, 2006
1 parent 2541edc commit 4f39f6d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 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: 4b832e8de22726206eb886f6dbff47a0f3fe5168
refs/heads/master: 695368ac3302174531429a90d55c3f7f9b83906e
16 changes: 6 additions & 10 deletions trunk/drivers/md/dm-snap.c
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,7 @@ static void error_bios(struct bio *bio)
}
}

static void __invalidate_snapshot(struct dm_snapshot *s,
struct pending_exception *pe, int err)
static void __invalidate_snapshot(struct dm_snapshot *s, int err)
{
if (!s->valid)
return;
Expand All @@ -642,9 +641,6 @@ static void __invalidate_snapshot(struct dm_snapshot *s,
else if (err == -ENOMEM)
DMERR("Invalidating snapshot: Unable to allocate exception.");

if (pe)
remove_exception(&pe->e);

if (s->store.drop_snapshot)
s->store.drop_snapshot(&s->store);

Expand Down Expand Up @@ -701,15 +697,15 @@ static void pending_complete(struct pending_exception *pe, int success)
if (!success) {
/* Read/write error - snapshot is unusable */
down_write(&s->lock);
__invalidate_snapshot(s, pe, -EIO);
__invalidate_snapshot(s, -EIO);
error = 1;
goto out;
}

e = alloc_exception();
if (!e) {
down_write(&s->lock);
__invalidate_snapshot(s, pe, -ENOMEM);
__invalidate_snapshot(s, -ENOMEM);
error = 1;
goto out;
}
Expand All @@ -727,9 +723,9 @@ static void pending_complete(struct pending_exception *pe, int success)
* in-flight exception from the list.
*/
insert_exception(&s->complete, e);
remove_exception(&pe->e);

out:
remove_exception(&pe->e);
snapshot_bios = bio_list_get(&pe->snapshot_bios);
origin_bios = put_pending_exception(pe);

Expand Down Expand Up @@ -909,7 +905,7 @@ static int snapshot_map(struct dm_target *ti, struct bio *bio,
if (bio_rw(bio) == WRITE) {
pe = __find_pending_exception(s, bio);
if (!pe) {
__invalidate_snapshot(s, pe, -ENOMEM);
__invalidate_snapshot(s, -ENOMEM);
r = -EIO;
goto out_unlock;
}
Expand Down Expand Up @@ -1035,7 +1031,7 @@ static int __origin_write(struct list_head *snapshots, struct bio *bio)

pe = __find_pending_exception(snap, bio);
if (!pe) {
__invalidate_snapshot(snap, pe, -ENOMEM);
__invalidate_snapshot(snap, -ENOMEM);
goto next_snapshot;
}

Expand Down

0 comments on commit 4f39f6d

Please sign in to comment.