Re: [PATCH] nbd: maintain compatibility with existing nbd tools

Pavel Machek (pavel@suse.cz)
Sun, 29 Jun 2003 20:42:53 +0200


Hi!

> > [ ... ] In the meantime, the nbd-client tool currently can't correctly set
> > the size of the device and either that needs to be worked around in the
> > driver (I'd done that in the original jumbo patch), or the nbd-client
> > tool needs to be updated (the patch I'd mailed out for nbd-client works
> > around the sizing issue by re-opening the nbd). To be clear, that's not
> > something any of the changes that have gone in so far broke nor address.
> > It's a consequence of how bd_set_size() is called in fs/block_dev.c
> > do_open().
>
> And here's the (tiny) patch for nbd to maintain compatibility with the
> existing nbd-client tool. Compiled and tested on a couple machines.
> Please apply.

You are the maintainer, you can go to the linus directly. (I hope
Linus took that MAINTAINERS patch). Or you can send this to Rusty
'trivial patch monkey' russel. It seems easy enough.

Pavel

[Aha, if you wanted *Andrew* to apply it... I guess it is better to
say directly who do you want to take it.]

> Thanks,
> Paul

Content-Description: nbd patch
> --- nbd.c.ORIG 2003-06-26 10:35:43.000000000 -0400
> +++ nbd.c 2003-06-26 17:03:08.000000000 -0400
> @@ -465,15 +468,18 @@
> lo->blksize_bits++;
> temp >>= 1;
> }
> - lo->bytesize &= ~(lo->blksize-1);
> + lo->bytesize &= ~(lo->blksize-1);
> + inode->i_bdev->bd_inode->i_size = lo->bytesize;
> set_capacity(lo->disk, lo->bytesize >> 9);
> return 0;
> case NBD_SET_SIZE:
> - lo->bytesize = arg & ~(lo->blksize-1);
> + lo->bytesize = arg & ~(lo->blksize-1);
> + inode->i_bdev->bd_inode->i_size = lo->bytesize;
> set_capacity(lo->disk, lo->bytesize >> 9);
> return 0;
> case NBD_SET_SIZE_BLOCKS:
> lo->bytesize = ((u64) arg) << lo->blksize_bits;
> + inode->i_bdev->bd_inode->i_size = lo->bytesize;
> set_capacity(lo->disk, lo->bytesize >> 9);
> return 0;
> case NBD_DO_IT:

-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/