* [PATCH 0/3] fs, bdev: handle end of life
@ 2015-12-01 23:58 Dan Williams
2015-12-01 23:58 ` [PATCH 2/3] xfs: handle shutdown notifications Dan Williams
0 siblings, 1 reply; 4+ messages in thread
From: Dan Williams @ 2015-12-01 23:58 UTC (permalink / raw)
To: linux-fsdevel
Cc: Jens Axboe, linux-nvdimm, xfs, linux-block, Jan Kara, Tejun Heo,
Matthew Wilcox, Ross Zwisler
As mentioned in [PATCH 1/3] "block, fs: reliably communicate bdev
end-of-life", historically we have waited for filesystem specific
heuristics to attempt to guess when a block device is gone. Sometimes
this works, but in other cases the system can hang waiting for the fs to
trigger its shutdown protocol.
Now with DAX we need new actions, like unmapping all inodes, to be taken
upon a shutdown event. Those actions need to be taken whether the
shutdown event comes from the block device being torn down, or some
other file system specific event.
For now, the approach taken in the following patches only affects xfs
and block drivers that are converted to use del_gendisk_queue(). We can
add more filesystems and driver support over time.
Note that 'bdi_gone' was chosen over 'shutdown' so as not to be confused
with generic_shutdown_super()
---
Dan Williams (3):
block, fs: reliably communicate bdev end-of-life
xfs: handle shutdown notifications
writeback: fix false positive WARN in __mark_inode_dirty
block/genhd.c | 87 +++++++++++++++++++++++++++++++++++-------
drivers/block/brd.c | 3 -
drivers/nvdimm/pmem.c | 3 -
drivers/s390/block/dcssblk.c | 6 +--
fs/block_dev.c | 79 +++++++++++++++++++++++++++++++++-----
fs/xfs/xfs_super.c | 9 ++++
include/linux/fs.h | 4 ++
include/linux/genhd.h | 1
mm/backing-dev.c | 7 +++
9 files changed, 166 insertions(+), 33 deletions(-)
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/3] xfs: handle shutdown notifications
2015-12-01 23:58 [PATCH 0/3] fs, bdev: handle end of life Dan Williams
@ 2015-12-01 23:58 ` Dan Williams
2015-12-23 2:39 ` Dan Williams
2016-01-03 21:05 ` Dave Chinner
0 siblings, 2 replies; 4+ messages in thread
From: Dan Williams @ 2015-12-01 23:58 UTC (permalink / raw)
To: linux-fsdevel; +Cc: linux-block, xfs, linux-nvdimm
Force a filesystem shutdown when the backing device is known to be dead.
I.e. blk_queue_enter() permanently returns -ENODEV.
Cc: xfs@oss.sgi.com
Suggested-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
fs/block_dev.c | 3 ++-
fs/xfs/xfs_super.c | 9 +++++++++
include/linux/fs.h | 2 ++
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 39989e990df9..dfe9a53a7c53 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1802,7 +1802,7 @@ int __invalidate_device(struct block_device *bdev, bool kill_dirty)
}
EXPORT_SYMBOL(__invalidate_device);
-static void generic_bdi_gone(struct super_block *sb)
+void generic_bdi_gone(struct super_block *sb)
{
struct inode *inode, *_inode = NULL;
@@ -1828,6 +1828,7 @@ static void generic_bdi_gone(struct super_block *sb)
spin_unlock(&sb->s_inode_list_lock);
iput(_inode);
}
+EXPORT_SYMBOL(generic_bdi_gone);
void shutdown_partition(struct gendisk *disk, int partno)
{
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 36bd8825bfb0..63c36508e9db 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -1618,6 +1618,14 @@ xfs_fs_free_cached_objects(
return xfs_reclaim_inodes_nr(XFS_M(sb), sc->nr_to_scan);
}
+static void
+xfs_fs_bdi_gone(
+ struct super_block *sb)
+{
+ xfs_force_shutdown(XFS_M(sb), SHUTDOWN_DEVICE_REQ);
+ generic_bdi_gone(sb);
+}
+
static const struct super_operations xfs_super_operations = {
.alloc_inode = xfs_fs_alloc_inode,
.destroy_inode = xfs_fs_destroy_inode,
@@ -1632,6 +1640,7 @@ static const struct super_operations xfs_super_operations = {
.show_options = xfs_fs_show_options,
.nr_cached_objects = xfs_fs_nr_cached_objects,
.free_cached_objects = xfs_fs_free_cached_objects,
+ .bdi_gone = xfs_fs_bdi_gone,
};
static struct file_system_type xfs_fs_type = {
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 0e201ed38045..b1e8e049e4b8 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2265,6 +2265,7 @@ extern struct super_block *freeze_bdev(struct block_device *);
extern void emergency_thaw_all(void);
extern int thaw_bdev(struct block_device *bdev, struct super_block *sb);
extern int fsync_bdev(struct block_device *);
+extern void generic_bdi_gone(struct super_block *sb);
extern struct super_block *blockdev_superblock;
@@ -2277,6 +2278,7 @@ static inline void bd_forget(struct inode *inode) {}
static inline int sync_blockdev(struct block_device *bdev) { return 0; }
static inline void kill_bdev(struct block_device *bdev) {}
static inline void invalidate_bdev(struct block_device *bdev) {}
+static inline void generic_bdi_gone(struct super_block *sb) {}
static inline struct super_block *freeze_bdev(struct block_device *sb)
{
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/3] xfs: handle shutdown notifications
2015-12-01 23:58 ` [PATCH 2/3] xfs: handle shutdown notifications Dan Williams
@ 2015-12-23 2:39 ` Dan Williams
2016-01-03 21:05 ` Dave Chinner
1 sibling, 0 replies; 4+ messages in thread
From: Dan Williams @ 2015-12-23 2:39 UTC (permalink / raw)
To: linux-fsdevel; +Cc: linux-block, linux-nvdimm@lists.01.org, XFS Developers
Dave, I'm looking to push out a branch with this patch included. Any concerns?
On Tue, Dec 1, 2015 at 3:58 PM, Dan Williams <dan.j.williams@intel.com> wrote:
> Force a filesystem shutdown when the backing device is known to be dead.
> I.e. blk_queue_enter() permanently returns -ENODEV.
>
> Cc: xfs@oss.sgi.com
> Suggested-by: Dave Chinner <david@fromorbit.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
> fs/block_dev.c | 3 ++-
> fs/xfs/xfs_super.c | 9 +++++++++
> include/linux/fs.h | 2 ++
> 3 files changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/fs/block_dev.c b/fs/block_dev.c
> index 39989e990df9..dfe9a53a7c53 100644
> --- a/fs/block_dev.c
> +++ b/fs/block_dev.c
> @@ -1802,7 +1802,7 @@ int __invalidate_device(struct block_device *bdev, bool kill_dirty)
> }
> EXPORT_SYMBOL(__invalidate_device);
>
> -static void generic_bdi_gone(struct super_block *sb)
> +void generic_bdi_gone(struct super_block *sb)
> {
> struct inode *inode, *_inode = NULL;
>
> @@ -1828,6 +1828,7 @@ static void generic_bdi_gone(struct super_block *sb)
> spin_unlock(&sb->s_inode_list_lock);
> iput(_inode);
> }
> +EXPORT_SYMBOL(generic_bdi_gone);
>
> void shutdown_partition(struct gendisk *disk, int partno)
> {
> diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
> index 36bd8825bfb0..63c36508e9db 100644
> --- a/fs/xfs/xfs_super.c
> +++ b/fs/xfs/xfs_super.c
> @@ -1618,6 +1618,14 @@ xfs_fs_free_cached_objects(
> return xfs_reclaim_inodes_nr(XFS_M(sb), sc->nr_to_scan);
> }
>
> +static void
> +xfs_fs_bdi_gone(
> + struct super_block *sb)
> +{
> + xfs_force_shutdown(XFS_M(sb), SHUTDOWN_DEVICE_REQ);
> + generic_bdi_gone(sb);
> +}
> +
> static const struct super_operations xfs_super_operations = {
> .alloc_inode = xfs_fs_alloc_inode,
> .destroy_inode = xfs_fs_destroy_inode,
> @@ -1632,6 +1640,7 @@ static const struct super_operations xfs_super_operations = {
> .show_options = xfs_fs_show_options,
> .nr_cached_objects = xfs_fs_nr_cached_objects,
> .free_cached_objects = xfs_fs_free_cached_objects,
> + .bdi_gone = xfs_fs_bdi_gone,
> };
>
> static struct file_system_type xfs_fs_type = {
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 0e201ed38045..b1e8e049e4b8 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -2265,6 +2265,7 @@ extern struct super_block *freeze_bdev(struct block_device *);
> extern void emergency_thaw_all(void);
> extern int thaw_bdev(struct block_device *bdev, struct super_block *sb);
> extern int fsync_bdev(struct block_device *);
> +extern void generic_bdi_gone(struct super_block *sb);
>
> extern struct super_block *blockdev_superblock;
>
> @@ -2277,6 +2278,7 @@ static inline void bd_forget(struct inode *inode) {}
> static inline int sync_blockdev(struct block_device *bdev) { return 0; }
> static inline void kill_bdev(struct block_device *bdev) {}
> static inline void invalidate_bdev(struct block_device *bdev) {}
> +static inline void generic_bdi_gone(struct super_block *sb) {}
>
> static inline struct super_block *freeze_bdev(struct block_device *sb)
> {
>
> _______________________________________________
> Linux-nvdimm mailing list
> Linux-nvdimm@lists.01.org
> https://lists.01.org/mailman/listinfo/linux-nvdimm
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/3] xfs: handle shutdown notifications
2015-12-01 23:58 ` [PATCH 2/3] xfs: handle shutdown notifications Dan Williams
2015-12-23 2:39 ` Dan Williams
@ 2016-01-03 21:05 ` Dave Chinner
1 sibling, 0 replies; 4+ messages in thread
From: Dave Chinner @ 2016-01-03 21:05 UTC (permalink / raw)
To: Dan Williams; +Cc: linux-fsdevel, linux-block, xfs, linux-nvdimm
On Tue, Dec 01, 2015 at 03:58:46PM -0800, Dan Williams wrote:
> Force a filesystem shutdown when the backing device is known to be dead.
> I.e. blk_queue_enter() permanently returns -ENODEV.
>
> Cc: xfs@oss.sgi.com
> Suggested-by: Dave Chinner <david@fromorbit.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
> fs/block_dev.c | 3 ++-
> fs/xfs/xfs_super.c | 9 +++++++++
> include/linux/fs.h | 2 ++
> 3 files changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/fs/block_dev.c b/fs/block_dev.c
> index 39989e990df9..dfe9a53a7c53 100644
> --- a/fs/block_dev.c
> +++ b/fs/block_dev.c
> @@ -1802,7 +1802,7 @@ int __invalidate_device(struct block_device *bdev, bool kill_dirty)
> }
> EXPORT_SYMBOL(__invalidate_device);
>
> -static void generic_bdi_gone(struct super_block *sb)
> +void generic_bdi_gone(struct super_block *sb)
> {
> struct inode *inode, *_inode = NULL;
>
> @@ -1828,6 +1828,7 @@ static void generic_bdi_gone(struct super_block *sb)
> spin_unlock(&sb->s_inode_list_lock);
> iput(_inode);
> }
> +EXPORT_SYMBOL(generic_bdi_gone);
>
> void shutdown_partition(struct gendisk *disk, int partno)
> {
> diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
> index 36bd8825bfb0..63c36508e9db 100644
> --- a/fs/xfs/xfs_super.c
> +++ b/fs/xfs/xfs_super.c
> @@ -1618,6 +1618,14 @@ xfs_fs_free_cached_objects(
> return xfs_reclaim_inodes_nr(XFS_M(sb), sc->nr_to_scan);
> }
>
> +static void
> +xfs_fs_bdi_gone(
> + struct super_block *sb)
> +{
> + xfs_force_shutdown(XFS_M(sb), SHUTDOWN_DEVICE_REQ);
> + generic_bdi_gone(sb);
> +}
You haven't cc'd me or the XFS list on the other patches in this
series, so I cannot comment as to whether this will work or not.
As I've asked before, please do not do single patch CC's like this
as it does not give the reviewer the context to be able to review
the change, nor is it possible to *apply and test* the patch they
are being asked to comment on.
Please resend the series with complete CC's to the relevant lists.
Sure, go ahead an CC individual people on certain patches, but you
need to make sure the whole patch series hit each mailing list....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-01-03 21:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-01 23:58 [PATCH 0/3] fs, bdev: handle end of life Dan Williams
2015-12-01 23:58 ` [PATCH 2/3] xfs: handle shutdown notifications Dan Williams
2015-12-23 2:39 ` Dan Williams
2016-01-03 21:05 ` Dave Chinner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox