diff options
author | Constantine Sapuntzakis <csapuntz@gmail.com> | 2006-06-23 05:06:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-23 10:43:09 -0400 |
commit | eefe85ee350ece1bdf3e9a61e941d3394a528660 (patch) | |
tree | 7ed531a7946a6d715622a7d39be9042c03de961d /drivers/block | |
parent | 98bd34eaf1a7d1f2ed9c4e5d3a9664d3dcdd2159 (diff) |
[PATCH] drivers/block/loop.c: don't return garbage if LOOP_SET_STATUS not called
While writing a version of losetup, I ran into the problem that the loop
device was returning total garbage.
It turns out the problem was that this losetup was only issuing the
LOOP_SET_FD ioctl and not issuing a subsequent LOOP_SET_STATUS ioctl. This
losetup didn't have any special status to set, so it left out the call.
The deeper cause is that loop_set_fd sets the transfer function to NULL,
which causes no transfer to happen lo_do_transfer.
This patch fixes the problem by setting transfer to transfer_none in
loop_set_fd.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/loop.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 9c3b94e8f03b..3c74ea729fc7 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c | |||
@@ -818,7 +818,7 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file, | |||
818 | lo->lo_device = bdev; | 818 | lo->lo_device = bdev; |
819 | lo->lo_flags = lo_flags; | 819 | lo->lo_flags = lo_flags; |
820 | lo->lo_backing_file = file; | 820 | lo->lo_backing_file = file; |
821 | lo->transfer = NULL; | 821 | lo->transfer = transfer_none; |
822 | lo->ioctl = NULL; | 822 | lo->ioctl = NULL; |
823 | lo->lo_sizelimit = 0; | 823 | lo->lo_sizelimit = 0; |
824 | lo->old_gfp_mask = mapping_gfp_mask(mapping); | 824 | lo->old_gfp_mask = mapping_gfp_mask(mapping); |