]>
Commit | Line | Data |
---|---|---|
cc90b958 BS |
1 | From: http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/5012c470f875 |
2 | # HG changeset 740 patch | |
3 | # User Keir Fraser <keir.fraser@citrix.com> | |
4 | # Date 1227697833 0 | |
5 | # Node ID 5012c470f8757e97c2e0f7eccfafcb1e2367443e | |
6 | # Parent f236d7def9944909bf40015ff4a08817b0803ed9 | |
7 | Subject: blkback, blktap: Fix potential resource leak. | |
8 | Patch-mainline: obsolete | |
9 | ||
10 | Signed-off-by: Keir Fraser <keir.fraser@citrix.com> | |
11 | Acked-by: jbeulich@novell.com | |
12 | ||
13 | Index: head-2008-12-01/drivers/xen/blkback/blkback.c | |
14 | =================================================================== | |
15 | --- head-2008-12-01.orig/drivers/xen/blkback/blkback.c 2008-11-10 11:44:21.000000000 +0100 | |
16 | +++ head-2008-12-01/drivers/xen/blkback/blkback.c 2008-12-01 11:21:10.000000000 +0100 | |
17 | @@ -317,14 +317,14 @@ static int do_block_io_op(blkif_t *blkif | |
18 | if (RING_REQUEST_CONS_OVERFLOW(&blk_rings->common, rc)) | |
19 | break; | |
20 | ||
21 | - pending_req = alloc_req(); | |
22 | - if (NULL == pending_req) { | |
23 | - blkif->st_oo_req++; | |
24 | + if (kthread_should_stop()) { | |
25 | more_to_do = 1; | |
26 | break; | |
27 | } | |
28 | ||
29 | - if (kthread_should_stop()) { | |
30 | + pending_req = alloc_req(); | |
31 | + if (NULL == pending_req) { | |
32 | + blkif->st_oo_req++; | |
33 | more_to_do = 1; | |
34 | break; | |
35 | } | |
36 | Index: head-2008-12-01/drivers/xen/blktap/blktap.c | |
37 | =================================================================== | |
38 | --- head-2008-12-01.orig/drivers/xen/blktap/blktap.c 2008-11-10 11:44:21.000000000 +0100 | |
39 | +++ head-2008-12-01/drivers/xen/blktap/blktap.c 2008-12-01 11:21:10.000000000 +0100 | |
40 | @@ -1286,14 +1286,14 @@ static int do_block_io_op(blkif_t *blkif | |
41 | break; | |
42 | } | |
43 | ||
44 | - pending_req = alloc_req(); | |
45 | - if (NULL == pending_req) { | |
46 | - blkif->st_oo_req++; | |
47 | + if (kthread_should_stop()) { | |
48 | more_to_do = 1; | |
49 | break; | |
50 | } | |
51 | ||
52 | - if (kthread_should_stop()) { | |
53 | + pending_req = alloc_req(); | |
54 | + if (NULL == pending_req) { | |
55 | + blkif->st_oo_req++; | |
56 | more_to_do = 1; | |
57 | break; | |
58 | } |