From 961cea154f7f4dd4d780f86a71d99d6a12ceb80b Mon Sep 17 00:00:00 2001 From: Fan Yong Date: Thu, 29 Apr 2010 14:06:37 +0800 Subject: [PATCH] b=16680 remove some noisy debug messages Remove some noisy debug messages. i=robert.read i=rahul.deshmukh --- .../patches/dev_read_only-2.6.18-vanilla.patch | 27 ++-------------------- .../patches/dev_read_only-2.6.27-vanilla.patch | 27 ++-------------------- lustre/obdfilter/filter_io_26.c | 13 ----------- lustre/tests/replay-dual.sh | 2 +- 4 files changed, 5 insertions(+), 64 deletions(-) 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 7da8a71..39c3b62 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 @@ -11,31 +11,20 @@ Index: linux-2.6.18.1/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. -@@ -3151,6 +3153,23 @@ end_io: +@@ -3151,6 +3153,12 @@ end_io: if (unlikely(test_bit(QUEUE_FLAG_DEAD, &q->queue_flags))) goto end_io; + /* this is cfs's dev_rdonly check */ + if (bio_rw(bio) == WRITE && dev_check_rdonly(bio->bi_bdev)) { -+ struct block_device *bdev = bio->bi_bdev; -+ -+ printk(KERN_WARNING "Write to readonly device %s (%#x) " -+ "bi_flags: %lx, bi_vcnt: %d, bi_idx: %d, " -+ "bi->size: %d, bi_cnt: %d, bi_private: %p\n", -+ bdev->bd_disk ? bdev->bd_disk->disk_name : "", -+ bdev->bd_dev, bio->bi_flags, bio->bi_vcnt, -+ bio->bi_idx, bio->bi_size, -+ atomic_read(&bio->bi_cnt), bio->bi_private); -+ set_bit(BIO_RDONLY, &bio->bi_flags); + bio_endio(bio, bio->bi_size, 0); -+ clear_bit(BIO_RDONLY, &bio->bi_flags); + break; + } + /* * If this device has partitions, remap block n -@@ -3765,6 +3784,91 @@ void swap_io_context(struct io_context * +@@ -3765,6 +3773,91 @@ void swap_io_context(struct io_context * *ioc2 = temp; } EXPORT_SYMBOL(swap_io_context); @@ -154,15 +143,3 @@ Index: linux-2.6.18.1/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); -Index: linux-2.6.18.1/include/linux/bio.h -=================================================================== ---- linux-2.6.18.1.orig/include/linux/bio.h -+++ linux-2.6.18.1/include/linux/bio.h -@@ -124,6 +124,7 @@ struct bio { - #define BIO_BOUNCED 5 /* bio is a bounce bio */ - #define BIO_USER_MAPPED 6 /* contains user pages */ - #define BIO_EOPNOTSUPP 7 /* not supported */ -+#define BIO_RDONLY 31 /* device is readonly */ - #define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag))) - - /* diff --git a/lustre/kernel_patches/patches/dev_read_only-2.6.27-vanilla.patch b/lustre/kernel_patches/patches/dev_read_only-2.6.27-vanilla.patch index d666236..de7804d 100644 --- a/lustre/kernel_patches/patches/dev_read_only-2.6.27-vanilla.patch +++ b/lustre/kernel_patches/patches/dev_read_only-2.6.27-vanilla.patch @@ -11,31 +11,20 @@ Index: linux-2.6.27.21-0.1/block/blk-core.c /* * Check whether this bio extends beyond the end of the device. */ -@@ -1436,6 +1438,23 @@ +@@ -1436,6 +1438,12 @@ if (unlikely(test_bit(QUEUE_FLAG_DEAD, &q->queue_flags))) goto end_io; + /* this is cfs's dev_rdonly check */ + if (bio_rw(bio) == WRITE && dev_check_rdonly(bio->bi_bdev)) { -+ struct block_device *bdev = bio->bi_bdev; -+ -+ printk(KERN_WARNING "Write to readonly device %s (%#x) " -+ "bi_flags: %lx, bi_vcnt: %d, bi_idx: %d, " -+ "bi->size: %d, bi_cnt: %d, bi_private: %p\n", -+ bdev->bd_disk ? bdev->bd_disk->disk_name : "", -+ bdev->bd_dev, bio->bi_flags, bio->bi_vcnt, -+ bio->bi_idx, bio->bi_size, -+ atomic_read(&bio->bi_cnt), bio->bi_private); -+ set_bit(BIO_RDONLY, &bio->bi_flags); + bio_endio(bio, bio->bi_size, 0); -+ clear_bit(BIO_RDONLY, &bio->bi_flags); + break; + } + if (should_fail_request(bio)) goto end_io; -@@ -2189,6 +2208,91 @@ +@@ -2189,6 +2197,91 @@ } EXPORT_SYMBOL(kblockd_flush_work); @@ -154,15 +143,3 @@ Index: linux-2.6.27.21-0.1/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); -Index: linux-2.6.27.21-0.1/include/linux/bio.h -=================================================================== ---- linux-2.6.27.21-0.1.orig/include/linux/bio.h 2009-05-22 08:38:00.000000000 -0600 -+++ linux-2.6.27.21-0.1/include/linux/bio.h 2009-05-22 08:38:02.000000000 -0600 -@@ -117,6 +117,7 @@ - #define BIO_CPU_AFFINE 8 /* complete bio on same CPU as submitted */ - #define BIO_FS_INTEGRITY 10 /* fs owns integrity data, not block layer */ - #define BIO_QUIET 11 /* Make BIO Quiet */ -+#define BIO_RDONLY 31 /* device is readonly */ - #define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag))) - - /* diff --git a/lustre/obdfilter/filter_io_26.c b/lustre/obdfilter/filter_io_26.c index 2c33cac..621ee05 100644 --- a/lustre/obdfilter/filter_io_26.c +++ b/lustre/obdfilter/filter_io_26.c @@ -133,19 +133,6 @@ static int dio_complete_routine(struct bio *bio, unsigned int done, int error) struct bio_vec *bvl; int i; - if (bio->bi_rw == WRITE && - unlikely(test_and_clear_bit(BIO_RDONLY, &bio->bi_flags))) { - struct block_device *bdev = bio->bi_bdev; - - CWARN("Write to readonly device %s (%#x) bi_flags: %lx, " - "bi_vcnt: %d, bi_idx: %d, bi->size: %d, bi_cnt: %d, " - "bi_private: %p, done: %u, error: %d\n", - bdev->bd_disk ? bdev->bd_disk->disk_name : "", - bdev->bd_dev, bio->bi_flags, bio->bi_vcnt, bio->bi_idx, - bio->bi_size, atomic_read(&bio->bi_cnt), bio->bi_private, - done, error); - } - /* CAVEAT EMPTOR: possibly in IRQ context * DO NOT record procfs stats here!!! */ diff --git a/lustre/tests/replay-dual.sh b/lustre/tests/replay-dual.sh index e6fb1a1..9131e9d 100755 --- a/lustre/tests/replay-dual.sh +++ b/lustre/tests/replay-dual.sh @@ -521,7 +521,7 @@ test_21b() { while true; do test_21b_sub mds$num || break; let n_attempts=n_attempts+1 - [ $n_attemtps -gt 3] && + [ $n_attempts -gt 3 ] && error "The test cannot check whether COS works or not: all renames are replied w/o COS" done restore_lustre_params < $param_file -- 1.8.3.1