Re: [CFT][PATCH] loopback fixes for 2.3

From: Alexander Viro (aviro@redhat.com)
Date: Sat Feb 12 2000 - 20:32:25 EST


On Sun, 13 Feb 2000, Alan Cox wrote:

> > Sigh... Alan, I'm sorry, but could you try to use /dev/loop on 2.3.43? And
> > watch the show. The most trivial test being: dd if=/dev/zero of=foo count=40
> > losetup /dev/loop0 foo; yes|dd count=20 >/dev/loop0; losetup -d /dev/loop0;
> > Now check foo. It was broken in many interesting ways.
>
> It works fine in 2.2.x. If I tweak my data it stops working in 2.2.x. You
> broke an on disk file system format, thats virtually a captal crime in my
> book 8)

Erm... There are two different issues: keeping the old semantics with all its
warts (trivial change in the module) and getting the sane semantics (became
possible now, requires data conversion). The latter was plain impossible with
the old loop.c - you can go from file block number to disk one, but not the
other way round. Not to mention the fact that doing disk block numbers over
NFS is nontrivial work ;-)

I consider the loop.c in 2.3.43 as completely b0rken, so if anybody used the
old encryption modules he was _deep_ in trouble. And yes, modules will have
to be updated. BTW, part of the b0rkenness in question was that it didn't care
to update req->sector between the parts of request. With obvious results.
2.2 worked since it prevented request merging for LOOP_MAJOR (explicit check
in ll_rw_blk.c)... Another part was that it used ->write() (and thus pagecache)
for filling the holes in underlying file, but used buffer cache for all IO.
Aliasing is fun...
 
> > The bottom line: encryption driver can trivially compensate for the change.
> > So if it's a problem with on-disk format - fine, let's keep the transformation
> > in the format-handling code.
>
> Ok. But we need to be able to keep the disk format constant.
        Sure. See another posting for the template of module change - it takes
about 5 lines of code. Corresponding patch to loop.c will be submitted to Linus.
Result: always sending the file block number, those who need absolute one are
welcome to do conversion. If there is no ->bmap() in address_space_operations
(e.g. for devices or for NFS) - fine, just use what you got. For devices it
will be the same thing as absolute block, for NFS you had no way to do
loopback anyway.

>And yes putting any grunge in the crypto is a good idea

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Feb 15 2000 - 21:00:24 EST