blob: 9aee0aa36dd21ddd91b4ad6a4bd01fdb41e9761d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
Index: vserver-sources-2.1.1_2.6.16/drivers/block/loop.c
===================================================================
--- vserver-sources-2.1.1_2.6.16.orig/drivers/block/loop.c
+++ vserver-sources-2.1.1_2.6.16/drivers/block/loop.c
@@ -747,6 +747,7 @@ static int loop_set_fd(struct loop_devic
int lo_flags = 0;
int error;
loff_t size;
+ pid_t pid;
/* This is safe, since we have a reference from open(). */
__module_get(THIS_MODULE);
@@ -839,10 +840,14 @@ static int loop_set_fd(struct loop_devic
set_blocksize(bdev, lo_blocksize);
- kernel_thread(loop_thread, lo, CLONE_KERNEL);
+ pid = kernel_thread(loop_thread, lo, CLONE_KERNEL);
+ if (pid < 0)
+ goto out_err;
wait_for_completion(&lo->lo_done);
return 0;
+ out_err:
+ error = (int)pid;
out_putf:
fput(file);
out:
|