From 2734662ce959f04e31a1de2714759d46aa7c9d4d Mon Sep 17 00:00:00 2001 From: deen <deen> Date: Thu, 31 May 2007 20:11:25 +0000 Subject: [PATCH] - dev_clear_rdonly(bdev) must be called in kill_bdev() instead of blkdev_put(). - revome ext3-wantedi-misc-2.6-suse.patch from fc5/fc3 series. b=11971 i=adilger i=nathan --- lustre/ChangeLog | 7 ++ .../patches/dev_read_only-2.6-fc5.patch | 75 +++++++++++++------ .../patches/dev_read_only-2.6-suse.patch | 56 +++++++------- .../dev_read_only-2.6.18-vanilla.patch | 41 +++++----- lustre/kernel_patches/series/2.6-fc3.series | 1 - lustre/kernel_patches/series/2.6-fc5.series | 1 - 6 files changed, 105 insertions(+), 76 deletions(-) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 2d53e4f5c9..2494850d30 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -254,6 +254,13 @@ Description: Set cat log bitmap only after create log success. Details : in some rare cases, the cat log bitmap is set too early. and it should be set only after create log success. +Severity : major +Bugzilla : 11971 +Description: Accessing a block bevice can re-enable I/O when Lustre is + tearing down a device. +Details : dev_clear_rdonly(bdev) must be called in kill_bdev() instead of + blkdev_put(). + -------------------------------------------------------------------------------- 2007-05-03 Cluster File Systems, Inc. <info@clusterfs.com> diff --git a/lustre/kernel_patches/patches/dev_read_only-2.6-fc5.patch b/lustre/kernel_patches/patches/dev_read_only-2.6-fc5.patch index 808f0b7547..4d420771db 100644 --- a/lustre/kernel_patches/patches/dev_read_only-2.6-fc5.patch +++ b/lustre/kernel_patches/patches/dev_read_only-2.6-fc5.patch @@ -1,20 +1,7 @@ -Index: linux-2.6.16.i686/fs/block_dev.c -=================================================================== ---- linux-2.6.16.i686.orig/fs/block_dev.c 2006-03-20 13:53:29.000000000 +0800 -+++ linux-2.6.16.i686/fs/block_dev.c 2006-05-30 21:15:22.000000000 +0800 -@@ -747,6 +747,7 @@ - } - unlock_kernel(); - up(&bdev->bd_sem); -+ dev_clear_rdonly(bdev); - bdput(bdev); - return ret; - } -Index: linux-2.6.16.i686/block/ll_rw_blk.c -=================================================================== ---- linux-2.6.16.i686.orig/block/ll_rw_blk.c 2006-05-30 15:47:03.000000000 +0800 -+++ linux-2.6.16.i686/block/ll_rw_blk.c 2006-05-30 21:18:49.000000000 +0800 -@@ -2940,6 +2940,8 @@ +diff -rup linux-2.6.16.i686.orig/block/ll_rw_blk.c linux-2.6.16.i686/block/ll_rw_blk.c +--- linux-2.6.16.i686.orig/block/ll_rw_blk.c 2007-05-29 15:24:36.000000000 +0300 ++++ linux-2.6.16.i686/block/ll_rw_blk.c 2007-05-29 15:33:50.000000000 +0300 +@@ -2940,6 +2940,8 @@ static void handle_bad_sector(struct bio set_bit(BIO_EOF, &bio->bi_flags); } @@ -23,7 +10,7 @@ Index: linux-2.6.16.i686/block/ll_rw_blk.c /** * generic_make_request: hand a buffer to its device driver for I/O * @bio: The bio describing the location in memory and on the device. -@@ -3020,6 +3022,12 @@ +@@ -3020,6 +3022,12 @@ end_io: if (unlikely(test_bit(QUEUE_FLAG_DEAD, &q->queue_flags))) goto end_io; @@ -36,7 +23,7 @@ Index: linux-2.6.16.i686/block/ll_rw_blk.c /* * If this device has partitions, remap block n -@@ -3593,6 +3601,91 @@ +@@ -3593,6 +3601,91 @@ void swap_io_context(struct io_context * *ioc2 = temp; } EXPORT_SYMBOL(swap_io_context); @@ -128,11 +115,21 @@ Index: linux-2.6.16.i686/block/ll_rw_blk.c /* * sysfs parts below -Index: linux-2.6.16.i686/include/linux/fs.h -=================================================================== ---- linux-2.6.16.i686.orig/include/linux/fs.h 2006-05-30 21:12:27.000000000 +0800 -+++ linux-2.6.16.i686/include/linux/fs.h 2006-05-30 21:15:22.000000000 +0800 -@@ -1558,6 +1558,10 @@ +diff -rup linux-2.6.16.i686.orig/fs/block_dev.c linux-2.6.16.i686/fs/block_dev.c +--- linux-2.6.16.i686.orig/fs/block_dev.c 2006-03-20 07:53:29.000000000 +0200 ++++ linux-2.6.16.i686/fs/block_dev.c 2007-05-29 15:35:00.000000000 +0300 +@@ -60,6 +60,7 @@ static void kill_bdev(struct block_devic + { + invalidate_bdev(bdev, 1); + truncate_inode_pages(bdev->bd_inode->i_mapping, 0); ++ dev_clear_rdonly(bdev); + } + + int set_blocksize(struct block_device *bdev, int size) +diff -rup linux-2.6.16.i686.orig/include/linux/fs.h linux-2.6.16.i686/include/linux/fs.h +--- linux-2.6.16.i686.orig/include/linux/fs.h 2007-05-29 15:24:38.000000000 +0300 ++++ linux-2.6.16.i686/include/linux/fs.h 2007-05-29 15:33:50.000000000 +0300 +@@ -1541,6 +1541,10 @@ extern void file_kill(struct file *f); struct bio; extern void submit_bio(int, struct bio *); extern int bdev_read_only(struct block_device *); @@ -143,3 +140,33 @@ Index: linux-2.6.16.i686/include/linux/fs.h extern int set_blocksize(struct block_device *, int); extern int sb_set_blocksize(struct super_block *, int); extern int sb_min_blocksize(struct super_block *, int); +diff -rup linux-2.6.16.i686.orig/include/linux/fs.h.orig linux-2.6.16.i686/include/linux/fs.h.orig +--- linux-2.6.16.i686.orig/include/linux/fs.h.orig 2007-05-29 15:24:37.000000000 +0300 ++++ linux-2.6.16.i686/include/linux/fs.h.orig 2007-05-29 15:24:38.000000000 +0300 +@@ -1568,7 +1568,7 @@ ssize_t generic_file_write_nolock(struct + extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *); + extern void do_generic_mapping_read(struct address_space *mapping, + struct file_ra_state *, struct file *, +- loff_t *, read_descriptor_t *, read_actor_t); ++ loff_t *, read_descriptor_t *, read_actor_t, int); + extern void + file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); + extern ssize_t generic_file_readv(struct file *filp, const struct iovec *iov, +@@ -1600,14 +1600,15 @@ static inline int xip_truncate_page(stru + + static inline void do_generic_file_read(struct file * filp, loff_t *ppos, + read_descriptor_t * desc, +- read_actor_t actor) ++ read_actor_t actor, int nonblock) + { + do_generic_mapping_read(filp->f_mapping, + &filp->f_ra, + filp, + ppos, + desc, +- actor); ++ actor, ++ nonblock); + } + + ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, diff --git a/lustre/kernel_patches/patches/dev_read_only-2.6-suse.patch b/lustre/kernel_patches/patches/dev_read_only-2.6-suse.patch index d5a5ac488a..406e155928 100644 --- a/lustre/kernel_patches/patches/dev_read_only-2.6-suse.patch +++ b/lustre/kernel_patches/patches/dev_read_only-2.6-suse.patch @@ -1,18 +1,18 @@ -diff -ur linux-2.6.5-lnxi.orig/drivers/block/ll_rw_blk.c linux-2.6.5-lnxi/drivers/block/ll_rw_blk.c ---- linux-2.6.5-lnxi.orig/drivers/block/ll_rw_blk.c 2005-04-11 10:16:14.278505679 -0700 -+++ linux-2.6.5-lnxi/drivers/block/ll_rw_blk.c 2005-04-11 09:42:22.750936924 -0700 -@@ -2458,6 +2458,8 @@ static inline void blk_partition_remap(s - } +diff -rup linux-2.6.5-7.283.orig/drivers/block/ll_rw_blk.c linux-2.6.5-7.283/drivers/block/ll_rw_blk.c +--- linux-2.6.5-7.283.orig/drivers/block/ll_rw_blk.c 2006-12-01 17:41:03.000000000 +0200 ++++ linux-2.6.5-7.283/drivers/block/ll_rw_blk.c 2007-05-29 15:03:34.000000000 +0300 +@@ -2494,6 +2494,8 @@ static inline int attempt_front_merge(re + return 0; } +int dev_check_rdonly(struct block_device *bdev); + /** - * generic_make_request: hand a buffer to its device driver for I/O - * @bio: The bio describing the location in memory and on the device. -@@ -2546,6 +2548,13 @@ end_io: - if (test_bit(QUEUE_FLAG_DEAD, &q->queue_flags)) - goto end_io; + * blk_attempt_remerge - attempt to remerge active head with next request + * @q: The &request_queue_t belonging to the device +@@ -2607,6 +2609,13 @@ again: + elv_merged_request(q, req); + goto out; + /* this is cfs's dev_rdonly check */ + if (bio->bi_rw == WRITE && @@ -22,10 +22,10 @@ diff -ur linux-2.6.5-lnxi.orig/drivers/block/ll_rw_blk.c linux-2.6.5-lnxi/driver + } + /* - * If this device has partitions, remap block n - * of partition p to block n+start(p) of the disk. -@@ -3078,6 +3087,92 @@ void swap_io_context(struct io_context * - } + * elevator says don't/can't merge. get new request + */ +@@ -3445,6 +3454,92 @@ EXPORT_SYMBOL(dev_clear_rdonly); + EXPORT_SYMBOL(dev_check_rdonly); /* + * Debug code for turning block devices "read-only" (will discard writes @@ -117,21 +117,21 @@ diff -ur linux-2.6.5-lnxi.orig/drivers/block/ll_rw_blk.c linux-2.6.5-lnxi/driver * sysfs parts below */ struct queue_sysfs_entry { -diff -ur linux-2.6.5-lnxi.orig/fs/block_dev.c linux-2.6.5-lnxi/fs/block_dev.c ---- linux-2.6.5-lnxi.orig/fs/block_dev.c 2004-11-11 07:28:30.000000000 -0800 -+++ linux-2.6.5-lnxi/fs/block_dev.c 2005-04-11 09:49:01.891407856 -0700 -@@ -739,6 +739,7 @@ int blkdev_put(struct block_device *bdev - } - unlock_kernel(); - up(&bdev->bd_sem); +diff -rup linux-2.6.5-7.283.orig/fs/block_dev.c linux-2.6.5-7.283/fs/block_dev.c +--- linux-2.6.5-7.283.orig/fs/block_dev.c 2006-12-01 17:39:59.000000000 +0200 ++++ linux-2.6.5-7.283/fs/block_dev.c 2007-05-29 15:04:56.000000000 +0300 +@@ -60,6 +60,7 @@ static void kill_bdev(struct block_devic + { + invalidate_bdev(bdev, 1); + truncate_inode_pages(bdev->bd_inode->i_mapping, 0); + dev_clear_rdonly(bdev); - bdput(bdev); - return ret; - } -diff -ur linux-2.6.5-lnxi.orig/include/linux/fs.h linux-2.6.5-lnxi/include/linux/fs.h ---- linux-2.6.5-lnxi.orig/include/linux/fs.h 2004-11-11 07:28:45.000000000 -0800 -+++ linux-2.6.5-lnxi/include/linux/fs.h 2005-04-11 09:43:27.423116140 -0700 -@@ -1385,6 +1385,10 @@ extern void file_kill(struct file *f); + } + + int set_blocksize(struct block_device *bdev, int size) +diff -rup linux-2.6.5-7.283.orig/include/linux/fs.h linux-2.6.5-7.283/include/linux/fs.h +--- linux-2.6.5-7.283.orig/include/linux/fs.h 2006-12-01 17:40:58.000000000 +0200 ++++ linux-2.6.5-7.283/include/linux/fs.h 2007-05-29 15:03:34.000000000 +0300 +@@ -1422,6 +1422,10 @@ extern void file_kill(struct file *f); struct bio; extern int submit_bio(int, struct bio *); extern int bdev_read_only(struct block_device *); diff --git a/lustre/kernel_patches/patches/dev_read_only-2.6.18-vanilla.patch b/lustre/kernel_patches/patches/dev_read_only-2.6.18-vanilla.patch index 253efb84cf..ff6cf917b7 100644 --- a/lustre/kernel_patches/patches/dev_read_only-2.6.18-vanilla.patch +++ b/lustre/kernel_patches/patches/dev_read_only-2.6.18-vanilla.patch @@ -1,19 +1,6 @@ -Index: linux-2.6/fs/block_dev.c -=================================================================== ---- linux-2.6.orig/fs/block_dev.c 2006-07-06 23:41:48.000000000 +0800 -+++ linux-2.6/fs/block_dev.c 2006-07-15 16:20:25.000000000 +0800 -@@ -1118,6 +1118,7 @@ static int __blkdev_put(struct block_dev - } - unlock_kernel(); - mutex_unlock(&bdev->bd_mutex); -+ dev_clear_rdonly(bdev); - bdput(bdev); - return ret; - } -Index: linux-2.6/block/ll_rw_blk.c -=================================================================== ---- linux-2.6.orig/block/ll_rw_blk.c 2006-07-10 22:30:08.000000000 +0800 -+++ linux-2.6/block/ll_rw_blk.c 2006-07-15 16:15:14.000000000 +0800 +diff -urp linux-2.6.18.1.orig/block/ll_rw_blk.c linux-2.6.18.1/block/ll_rw_blk.c +--- linux-2.6.18.1.orig/block/ll_rw_blk.c 2006-10-14 06:34:03.000000000 +0300 ++++ linux-2.6.18.1/block/ll_rw_blk.c 2007-05-29 14:50:46.000000000 +0300 @@ -2993,6 +2993,8 @@ static void handle_bad_sector(struct bio set_bit(BIO_EOF, &bio->bi_flags); } @@ -36,7 +23,7 @@ Index: linux-2.6/block/ll_rw_blk.c /* * If this device has partitions, remap block n -@@ -3673,6 +3681,91 @@ void swap_io_context(struct io_context * +@@ -3675,6 +3683,91 @@ void swap_io_context(struct io_context * *ioc2 = temp; } EXPORT_SYMBOL(swap_io_context); @@ -128,11 +115,21 @@ Index: linux-2.6/block/ll_rw_blk.c /* * sysfs parts below -Index: linux-2.6/include/linux/fs.h -=================================================================== ---- linux-2.6.orig/include/linux/fs.h 2006-07-15 16:14:58.000000000 +0800 -+++ linux-2.6/include/linux/fs.h 2006-07-15 16:15:14.000000000 +0800 -@@ -1648,6 +1648,10 @@ extern void file_kill(struct file *f); +diff -urp linux-2.6.18.1.orig/fs/block_dev.c linux-2.6.18.1/fs/block_dev.c +--- linux-2.6.18.1.orig/fs/block_dev.c 2006-10-14 06:34:03.000000000 +0300 ++++ linux-2.6.18.1/fs/block_dev.c 2007-05-29 14:53:38.000000000 +0300 +@@ -58,6 +58,7 @@ static void kill_bdev(struct block_devic + { + invalidate_bdev(bdev, 1); + truncate_inode_pages(bdev->bd_inode->i_mapping, 0); ++ dev_clear_rdonly(bdev); + } + + int set_blocksize(struct block_device *bdev, int size) +diff -urp linux-2.6.18.1.orig/include/linux/fs.h linux-2.6.18.1/include/linux/fs.h +--- linux-2.6.18.1.orig/include/linux/fs.h 2006-10-14 06:34:03.000000000 +0300 ++++ linux-2.6.18.1/include/linux/fs.h 2007-05-29 14:50:46.000000000 +0300 +@@ -1632,6 +1632,10 @@ extern void file_kill(struct file *f); struct bio; extern void submit_bio(int, struct bio *); extern int bdev_read_only(struct block_device *); diff --git a/lustre/kernel_patches/series/2.6-fc3.series b/lustre/kernel_patches/series/2.6-fc3.series index b2090f0b82..dff06960dc 100644 --- a/lustre/kernel_patches/series/2.6-fc3.series +++ b/lustre/kernel_patches/series/2.6-fc3.series @@ -4,7 +4,6 @@ fc3_to_rhel4_updates.patch vfs_intent-2.6-fc3.patch vfs_nointent-2.6-rhel4.patch vfs_races-2.6-fc3.patch -ext3-wantedi-misc-2.6-suse.patch nfs-cifs-intent-2.6-fc3.patch iopen-misc-2.6-fc3.patch export-truncate-2.6-suse.patch diff --git a/lustre/kernel_patches/series/2.6-fc5.series b/lustre/kernel_patches/series/2.6-fc5.series index 18357484b2..8dd8c569eb 100644 --- a/lustre/kernel_patches/series/2.6-fc5.series +++ b/lustre/kernel_patches/series/2.6-fc5.series @@ -2,7 +2,6 @@ lustre_version.patch vfs_intent-2.6-fc5.patch vfs_nointent-2.6-fc5.patch vfs_races-2.6.12.patch -ext3-wantedi-misc-2.6-suse.patch jbd-2.6.10-jcberr.patch nfs-cifs-intent-2.6-fc5.patch iopen-misc-2.6.12.patch -- GitLab