linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Alex Bligh <alex@alex.org.uk>
Cc: linux-fsdevel@vger.kernel.org, Jan Kara <jack@suse.cz>,
	Dave Chinner <dchinner@redhat.com>,
	Jens Axboe <jaxboe@fusionio.com>
Subject: Re: [BUG] + possible [PATCH]. blkdev_issue_flush is a NOOP for request based drivers
Date: Thu, 26 May 2011 14:53:47 +0200	[thread overview]
Message-ID: <20110526125347.GJ9715@htj.dyndns.org> (raw)
In-Reply-To: <CAFADAC5233F4420F6A9A594@nimrod.local>

Hello, Alex.

I'm confused (as usual).

On Thu, May 26, 2011 at 12:00:36PM +0100, Alex Bligh wrote:
> blkdev_issue_flush appears to be a NOOP for request-based srivers, because

Ummm... request based drivers have __make_request as its
->make_request_fn() which is set during queue allocation.

> it returns -ENXIO if no make_request_function is present. AIUI only bio
> based drivers have a make_request_function. The preceding comment suggests
> this is an attempt to avoid making a request to bio based drivers before
> their queue is set up.

If you look at the original commit which added the condition,

commit f10d9f617a65905c556c3b37c9b9646ae7d04ed7
Author: Dave Chinner <dchinner@redhat.com>
Date:   Tue Jul 13 17:50:50 2010 +1000

    blkdev: check for valid request queue before issuing flush

    Issuing a blkdev_issue_flush() on an unconfigured loop device causes a panic as
    q->make_request_fn is not configured. This can occur when trying to mount the
    unconfigured loop device as an XFS filesystem. There are no guards that catch
    the bio before the request function is called because we don't add a payload to
    the bio. Instead, manually check this case as soon as we have a pointer to the
    queue to flush.

    Signed-off-by: Dave Chinner <dchinner@redhat.com>
    Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
				    
It was added to work around uniitialized queue from loop device.  I
think this is the wrong place to check for this tho.  We should have
made loop to always initialize queue and use placeholder
make_request_fn for inactive devices.

> This should not exclude request based drivers from
> getting any flushes. Instead therefore check for EITHER
> make_request_function OR request_function and queue flags. The check for
> queue flags may be unnecessary as the block layer may simply not send the
> flush on.

Have you tested the code actually works as you expect it to?  Before
and after?

Thanks.

-- 
tejun

  reply	other threads:[~2011-05-26 12:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-26 11:00 [BUG] + possible [PATCH]. blkdev_issue_flush is a NOOP for request based drivers Alex Bligh
2011-05-26 12:53 ` Tejun Heo [this message]
2011-05-26 13:09   ` Alex Bligh

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=20110526125347.GJ9715@htj.dyndns.org \
    --to=tj@kernel.org \
    --cc=alex@alex.org.uk \
    --cc=dchinner@redhat.com \
    --cc=jack@suse.cz \
    --cc=jaxboe@fusionio.com \
    --cc=linux-fsdevel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).