linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Jeff Moyer <jmoyer@redhat.com>
Cc: linux-kernel@vger.kernel.org, David Howells <dhowells@redhat.com>,
	Chris Mason <chris.mason@fusionio.com>,
	Steve French <sfrench@samba.org>, Mark Fasheh <mfasheh@suse.com>,
	Joel Becker <jlbec@evilplan.org>, Matthew Wilcox <matthew@wil.cx>,
	linux-afs@lists.infradead.org, linux-fsdevel@vger.kernel.org,
	linux-btrfs@vger.kernel.org, linux-cifs@vger.kernel.org,
	samba-technical@lists.samba.org, ocfs2-devel@oss.oracle.com
Subject: Re: [patch 05/10] vfs: pass data to alloc_inode super operation
Date: Tue, 30 Oct 2012 21:17:01 +0000	[thread overview]
Message-ID: <20121030211701.GC2616@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20121030205142.GB2616@ZenIV.linux.org.uk>

On Tue, Oct 30, 2012 at 08:51:42PM +0000, Al Viro wrote:
> On Tue, Oct 30, 2012 at 04:14:39PM -0400, Jeff Moyer wrote:
> > This patch passes a data pointer along to the alloc_inode
> > super_operations function.  The value will initially be used by
> > bdev_alloc_inode to allocate the bdev_inode on the same numa
> > node as the device to which it is tied.
> 
> Yecchhh...
> 
> > -static struct inode *bdev_alloc_inode(struct super_block *sb)
> > +static struct inode *bdev_alloc_inode(struct super_block *sb, void *data)
> >  {
> > -	struct bdev_inode *ei = kmem_cache_alloc(bdev_cachep, GFP_KERNEL);
> > +	struct bdev_inode *ei;
> > +	int partno;
> > +	int node;
> > +
> > +	if (data) {
> > +		struct gendisk *disk;
> > +		dev_t dev = *(dev_t *)data;
> > +		disk = get_gendisk(dev, &partno);
> > +		node = disk->node_id;

BTW, speaking of other reasons this is FUBAR - mknod a block device node
for something that doesn't exist and try to open it.  struct block_device
lifetime is not limited to that of struct gendisk; it can be allocated
before gendisk is there.  Moreover, with static /dev and demand-loaded
modules this will be the normal scenario.

IOW, this is completely misguided.

  reply	other threads:[~2012-10-30 21:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1351628084-29358-1-git-send-email-jmoyer@redhat.com>
2012-10-30 20:14 ` [patch 05/10] vfs: pass data to alloc_inode super operation Jeff Moyer
     [not found]   ` <1351628084-29358-8-git-send-email-jmoyer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-10-30 20:51     ` Al Viro
2012-10-30 21:17       ` Al Viro [this message]
     [not found]         ` <20121030211701.GC2616-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
2012-10-31 13:22           ` Jeff Moyer

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=20121030211701.GC2616@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=chris.mason@fusionio.com \
    --cc=dhowells@redhat.com \
    --cc=jlbec@evilplan.org \
    --cc=jmoyer@redhat.com \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=mfasheh@suse.com \
    --cc=ocfs2-devel@oss.oracle.com \
    --cc=samba-technical@lists.samba.org \
    --cc=sfrench@samba.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).