lkml.org 
[lkml]   [2003]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 2.5.73] nbd: maintain compatibility with existing nbd tools
On Sun, 29 Jun 2003, Pavel Machek wrote:

> > > [ ... ] 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).

Not yet, I don't think...

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

Well, it's just that Andrew seems particularly willing to help on this,
so that's why I sent to him...

At any rate, Andrew, here's a cleaned up version of the patch... please apply.

Thanks,
Paul
--- linux-2.5/drivers/block/nbd.c.PRISTINE Sat Jun 28 12:57:03 2003
+++ linux-2.5/drivers/block/nbd.c Sat Jun 28 12:57:54 2003
@@ -503,15 +503,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:
\
 
 \ /
  Last update: 2005-03-22 13:46    [W:0.063 / U:0.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site