]> pilppa.com Git - linux-2.6-omap-h63xx.git/commit
[PATCH] drivers/block/loop.c: don't return garbage if LOOP_SET_STATUS not called
authorConstantine Sapuntzakis <csapuntz@gmail.com>
Fri, 23 Jun 2006 09:06:08 +0000 (02:06 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 23 Jun 2006 14:43:09 +0000 (07:43 -0700)
commiteefe85ee350ece1bdf3e9a61e941d3394a528660
tree7ed531a7946a6d715622a7d39be9042c03de961d
parent98bd34eaf1a7d1f2ed9c4e5d3a9664d3dcdd2159
[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>
drivers/block/loop.c