From: Christoph Hellwig <hch@infradead.org>
To: Jan Kara <jack@suse.cz>
Cc: Christoph Hellwig <hch@infradead.org>,
LKML <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 1/3] bdi: Use parent filesystem BDI for inodes not capable of writeback
Date: Tue, 27 Jul 2010 16:12:07 -0400 [thread overview]
Message-ID: <20100727201207.GA16335@infradead.org> (raw)
In-Reply-To: <20100727180131.GG6820@quack.suse.cz>
On Tue, Jul 27, 2010 at 08:01:31PM +0200, Jan Kara wrote:
> > It shouldn't. Block device nodes are on the bdev filesystems, and
> Ok, so inode->i_sb->s_bdi will actually point to noop_backing_dev_info
> as set by set_anon_super(). Or am I completely out?
I think you're right. This seems rather bad if it's indeed true. I'll
quickly verify it using Dave's new tracing once I've built a block
tree kernel.
> > we twist the file->mapping pointer so that all the low-level read/write
> > code always deals with the bdev fs inode, and not the device node
> > filesystem.
>
> Yes, I know this but I fail to see how this influences where </dev/sda's
> inode>->i_sb->s_bdi ends up...
Ok, let's say we write to /dev/sda. For this we call
blkdev_aio_write -> __generic_file_aio_write
There we get the inode we operate on as
struct file *file = iocb->ki_filp;
struct address_space * mapping = file->f_mapping;
struct inode *inode = mapping->host;
Now file->f_mapping gets set up in blkdev_open as:
filp->f_mapping = bdev->bd_inode->i_mapping;
so it does not point to the inode of the device node, but an inode on
the bdev filesystem.
next prev parent reply other threads:[~2010-07-27 20:12 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-27 17:04 [PATCH 0/3] Fix warnings in __mark_inode_dirty Jan Kara
2010-07-27 17:04 ` [PATCH 1/3] bdi: Use parent filesystem BDI for inodes not capable of writeback Jan Kara
2010-07-27 17:09 ` Christoph Hellwig
2010-07-27 17:24 ` Jan Kara
2010-07-27 17:27 ` Christoph Hellwig
2010-07-27 18:01 ` Jan Kara
2010-07-27 20:12 ` Christoph Hellwig [this message]
2010-07-27 20:21 ` Christoph Hellwig
2010-07-27 20:44 ` Jan Kara
2010-07-27 20:46 ` Christoph Hellwig
2010-07-29 8:12 ` Christoph Hellwig
2010-07-29 12:17 ` Jan Kara
2010-07-27 17:05 ` [PATCH 2/3] char: Mark /dev/zero and /dev/kmem as " Jan Kara
2010-07-27 17:05 ` [PATCH 3/3] bdi: Initialize noop_backing_dev_info properly Jan Kara
2010-07-27 17:09 ` Christoph Hellwig
2010-07-27 17:17 ` Jan Kara
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=20100727201207.GA16335@infradead.org \
--to=hch@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=jack@suse.cz \
--cc=linux-kernel@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