All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: Joe Thornber <joe@fib011235813.fsnet.co.uk>
Cc: linux-lvm@sistina.com, linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@zip.com.au>
Subject: Re: [linux-lvm] LVM2 modifies the buffer_head struct?
Date: Wed Jul  3 07:10:01 2002	[thread overview]
Message-ID: <20020703121024.GC21568@suse.de> (raw)
In-Reply-To: <20020703120124.GB615@fib011235813.fsnet.co.uk>

On Wed, Jul 03 2002, Joe Thornber wrote:
> On Wed, Jul 03, 2002 at 12:08:38PM +0200, Jens Axboe wrote:
> > On Tue, Jul 02 2002, Joe Thornber wrote:
> > > Tom,
> > > 
> > > On Tue, Jul 02, 2002 at 09:40:56AM -0400, Tom Walcott wrote:
> > > > Hello,
> > > > 
> > > > Browsing the patch submitted for 2.4 inclusion, I noticed that LVM2 
> > > > modifies the buffer_head struct. Why does LVM2 require the addition of it's 
> > > > own private field in the buffer_head? It seems that it should be able to 
> > > > use the existing b_private field.
> > > 
> > > This is a horrible hack to get around the fact that ext3 uses the
> > > b_private field for its own purposes after the buffer_head has been
> > > handed to the block layer (it doesn't just use b_private when in the
> > > b_end_io function).  Is this acceptable behaviour ?  Other filesystems
> > > do not have similar problems as far as I know.
> > > 
> > > device-mapper uses the b_private field to 'hook' the buffer_heads so
> > > it can keep track of in flight ios (essential for implementing
> > > suspend/resume correctly).  See dm.c:dec_pending()
> > 
> > Your driver is required to properly stack b_private uses, however if
> > ext3 (well jbd really) over writes b_private after bh i/o submission I
> > would say that it is broken.
> 
> AFAIK ext3 doesn't overwrite b_private after submission, but does
> expect the value not to change (ie. no stacking to be taking place).

Now we are in a grey area. The 'usual' stacked drivers work like this:

some fs path
	submit_bh(bh_orig);

...

stacked driver make_request_fn:
	bh_new = alloc_bh
	bh_new->b_private = bh_orig;
	...
	submit_bh(bh_new);

if you are just modifying b_private, how exactly is your stacking
working? ie what about lvm2 on lvm2?

-- 
Jens Axboe

WARNING: multiple messages have this Message-ID (diff)
From: Jens Axboe <axboe@suse.de>
To: Joe Thornber <joe@fib011235813.fsnet.co.uk>
Cc: linux-lvm@sistina.com, linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@zip.com.au>
Subject: Re: [linux-lvm] LVM2 modifies the buffer_head struct?
Date: Wed, 3 Jul 2002 14:10:24 +0200	[thread overview]
Message-ID: <20020703121024.GC21568@suse.de> (raw)
In-Reply-To: <20020703120124.GB615@fib011235813.fsnet.co.uk>

On Wed, Jul 03 2002, Joe Thornber wrote:
> On Wed, Jul 03, 2002 at 12:08:38PM +0200, Jens Axboe wrote:
> > On Tue, Jul 02 2002, Joe Thornber wrote:
> > > Tom,
> > > 
> > > On Tue, Jul 02, 2002 at 09:40:56AM -0400, Tom Walcott wrote:
> > > > Hello,
> > > > 
> > > > Browsing the patch submitted for 2.4 inclusion, I noticed that LVM2 
> > > > modifies the buffer_head struct. Why does LVM2 require the addition of it's 
> > > > own private field in the buffer_head? It seems that it should be able to 
> > > > use the existing b_private field.
> > > 
> > > This is a horrible hack to get around the fact that ext3 uses the
> > > b_private field for its own purposes after the buffer_head has been
> > > handed to the block layer (it doesn't just use b_private when in the
> > > b_end_io function).  Is this acceptable behaviour ?  Other filesystems
> > > do not have similar problems as far as I know.
> > > 
> > > device-mapper uses the b_private field to 'hook' the buffer_heads so
> > > it can keep track of in flight ios (essential for implementing
> > > suspend/resume correctly).  See dm.c:dec_pending()
> > 
> > Your driver is required to properly stack b_private uses, however if
> > ext3 (well jbd really) over writes b_private after bh i/o submission I
> > would say that it is broken.
> 
> AFAIK ext3 doesn't overwrite b_private after submission, but does
> expect the value not to change (ie. no stacking to be taking place).

Now we are in a grey area. The 'usual' stacked drivers work like this:

some fs path
	submit_bh(bh_orig);

...

stacked driver make_request_fn:
	bh_new = alloc_bh
	bh_new->b_private = bh_orig;
	...
	submit_bh(bh_new);

if you are just modifying b_private, how exactly is your stacking
working? ie what about lvm2 on lvm2?

-- 
Jens Axboe


  reply	other threads:[~2002-07-03  7:10 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-02  8:41 [linux-lvm] LVM2 modifies the buffer_head struct? Tom Walcott
2002-07-02  9:17 ` Joe Thornber
2002-07-02 14:17   ` Joe Thornber
2002-07-03  5:09   ` Jens Axboe
2002-07-03 10:08     ` Jens Axboe
2002-07-03  5:23     ` Andrew Morton
2002-07-03 10:28       ` Andrew Morton
2002-07-03  7:01     ` Joe Thornber
2002-07-03 12:01       ` Joe Thornber
2002-07-03  7:10       ` Jens Axboe [this message]
2002-07-03 12:10         ` Jens Axboe
2002-07-03 23:44         ` Neil Brown
2002-07-04  4:46           ` Neil Brown
2002-07-04  0:39           ` Andrew Morton
2002-07-04  5:44             ` Andrew Morton
2002-07-04  2:46           ` Joe Thornber
2002-07-04  7:45             ` Joe Thornber
2002-07-04  2:58           ` Jens Axboe
2002-07-04  7:58             ` Jens Axboe
2002-07-04  3:34             ` Andrew Morton
2002-07-04  8:40               ` Andrew Morton
2002-07-04  3:40               ` Jens Axboe
2002-07-04  8:39                 ` Jens Axboe
2002-07-04  3:58                 ` Joe Thornber
2002-07-04  8:57                   ` Joe Thornber
2002-07-04  4:00                   ` Jens Axboe
2002-07-04  9:00                     ` Jens Axboe
2002-07-04  4:38                 ` Andrew Morton
2002-07-04  9:44                   ` Andrew Morton
2002-07-07 14:52                   ` Joe Thornber
2002-07-07 20:51                     ` Joe Thornber
  -- strict thread matches above, loose matches on Subject: below --
2002-07-05  0:21 Mark Peloquin
2002-07-05 15:23 Mark Peloquin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020703121024.GC21568@suse.de \
    --to=axboe@suse.de \
    --cc=akpm@zip.com.au \
    --cc=joe@fib011235813.fsnet.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-lvm@sistina.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.