| To: | Ross Zwisler <ross.zwisler@xxxxxxxxxxxxxxx> |
|---|---|
| Subject: | Re: [PATCH] dax: allow DAX to look up an inode's block device |
| From: | Al Viro <viro@xxxxxxxxxxxxxxxxxx> |
| Date: | Tue, 2 Feb 2016 23:19:31 +0000 |
| Cc: | linux-kernel@xxxxxxxxxxxxxxx, "J. Bruce Fields" <bfields@xxxxxxxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Dan Williams <dan.j.williams@xxxxxxxxx>, Dave Chinner <david@xxxxxxxxxxxxx>, Jan Kara <jack@xxxxxxxx>, Jeff Layton <jlayton@xxxxxxxxxxxxxxx>, Matthew Wilcox <willy@xxxxxxxxxxxxxxx>, linux-fsdevel@xxxxxxxxxxxxxxx, linux-nvdimm@xxxxxxxxxxx, xfs@xxxxxxxxxxx |
| Delivered-to: | xfs@xxxxxxxxxxx |
| In-reply-to: | <1454454702-11889-1-git-send-email-ross.zwisler@xxxxxxxxxxxxxxx> |
| References: | <1454454702-11889-1-git-send-email-ross.zwisler@xxxxxxxxxxxxxxx> |
| Sender: | Al Viro <viro@xxxxxxxxxxxxxxxx> |
| User-agent: | Mutt/1.5.21 (2010-09-15) |
On Tue, Feb 02, 2016 at 04:11:42PM -0700, Ross Zwisler wrote: > However, for raw block devices and for XFS with a real-time device, the > value in inode->i_sb->s_bdev is not correct. With the code as it is > currently written, an fsync or msync to a DAX enabled raw block device will > cause a NULL pointer dereference kernel BUG. For this to work correctly we > need to ask the block device or filesystem what struct block_device is > appropriate for our inode. > > To that end, add a get_bdev(struct inode *) entry point to struct > super_operations. If this function pointer is non-NULL, this notifies DAX > that it needs to use it to look up the correct block_device. If > i_sb->get_bdev() is NULL DAX will default to inode->i_sb->s_bdev. Umm... It assumes that bdev will stay pinned for as long as inode is referenced, presumably? If so, that needs to be documented (and verified for existing fs instances). In principle, multi-disk fs might want to support things like "silently move the inodes backed by that disk to other ones"... |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [PATCH] dax: allow DAX to look up an inode's block device, Ross Zwisler |
|---|---|
| Next by Date: | Re: [PATCH 3/3] xfs: check sizes of XFS on-disk structures at compile time, Darrick J. Wong |
| Previous by Thread: | [PATCH] dax: allow DAX to look up an inode's block device, Ross Zwisler |
| Next by Thread: | Re: [PATCH] dax: allow DAX to look up an inode's block device, Jared Hulbert |
| Indexes: | [Date] [Thread] [Top] [All Lists] |