Skip to content
Snippets Groups Projects
Commit d161899c authored by Wang Di's avatar Wang Di
Browse files

Branch:b1_6

fix a bug in dev_read_only-2.6-suse.patch(brought by 11971), which make
dev read_only can not work.
b=13085
i=green
i=shadow
parent e9639431
No related merge requests found
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 Index: linux-2.6.9/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 --- linux-2.6.9.orig/drivers/block/ll_rw_blk.c
@@ -2494,6 +2494,8 @@ static inline int attempt_front_merge(re +++ linux-2.6.9/drivers/block/ll_rw_blk.c
@@ -2326,6 +2326,8 @@ static inline int attempt_front_merge(re
return 0; return 0;
} }
...@@ -10,9 +11,9 @@ diff -rup linux-2.6.5-7.283.orig/drivers/block/ll_rw_blk.c linux-2.6.5-7.283/dri ...@@ -10,9 +11,9 @@ diff -rup linux-2.6.5-7.283.orig/drivers/block/ll_rw_blk.c linux-2.6.5-7.283/dri
/** /**
* blk_attempt_remerge - attempt to remerge active head with next request * blk_attempt_remerge - attempt to remerge active head with next request
* @q: The &request_queue_t belonging to the device * @q: The &request_queue_t belonging to the device
@@ -2607,6 +2609,13 @@ again: @@ -2631,6 +2633,13 @@ end_io:
elv_merged_request(q, req); if (test_bit(QUEUE_FLAG_DEAD, &q->queue_flags))
goto out; goto end_io;
+ /* this is cfs's dev_rdonly check */ + /* this is cfs's dev_rdonly check */
+ if (bio->bi_rw == WRITE && + if (bio->bi_rw == WRITE &&
...@@ -22,10 +23,10 @@ diff -rup linux-2.6.5-7.283.orig/drivers/block/ll_rw_blk.c linux-2.6.5-7.283/dri ...@@ -22,10 +23,10 @@ diff -rup linux-2.6.5-7.283.orig/drivers/block/ll_rw_blk.c linux-2.6.5-7.283/dri
+ } + }
+ +
/* /*
* elevator says don't/can't merge. get new request * If this device has partitions, remap block n
*/ * of partition p to block n+start(p) of the disk.
@@ -3445,6 +3454,92 @@ EXPORT_SYMBOL(dev_clear_rdonly); @@ -3180,6 +3189,92 @@ void swap_io_context(struct io_context *
EXPORT_SYMBOL(dev_check_rdonly);
/* /*
+ * Debug code for turning block devices "read-only" (will discard writes + * Debug code for turning block devices "read-only" (will discard writes
...@@ -117,9 +118,10 @@ diff -rup linux-2.6.5-7.283.orig/drivers/block/ll_rw_blk.c linux-2.6.5-7.283/dri ...@@ -117,9 +118,10 @@ diff -rup linux-2.6.5-7.283.orig/drivers/block/ll_rw_blk.c linux-2.6.5-7.283/dri
* sysfs parts below * sysfs parts below
*/ */
struct queue_sysfs_entry { struct queue_sysfs_entry {
diff -rup linux-2.6.5-7.283.orig/fs/block_dev.c linux-2.6.5-7.283/fs/block_dev.c Index: linux-2.6.9/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 --- linux-2.6.9.orig/fs/block_dev.c
+++ linux-2.6.9/fs/block_dev.c
@@ -60,6 +60,7 @@ static void kill_bdev(struct block_devic @@ -60,6 +60,7 @@ static void kill_bdev(struct block_devic
{ {
invalidate_bdev(bdev, 1); invalidate_bdev(bdev, 1);
...@@ -128,12 +130,13 @@ diff -rup linux-2.6.5-7.283.orig/fs/block_dev.c linux-2.6.5-7.283/fs/block_dev.c ...@@ -128,12 +130,13 @@ diff -rup linux-2.6.5-7.283.orig/fs/block_dev.c linux-2.6.5-7.283/fs/block_dev.c
} }
int set_blocksize(struct block_device *bdev, int size) 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 Index: linux-2.6.9/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 --- linux-2.6.9.orig/include/linux/fs.h
@@ -1422,6 +1422,10 @@ extern void file_kill(struct file *f); +++ linux-2.6.9/include/linux/fs.h
@@ -1492,6 +1492,10 @@ extern void file_kill(struct file *f);
struct bio; struct bio;
extern int submit_bio(int, struct bio *); extern void submit_bio(int, struct bio *);
extern int bdev_read_only(struct block_device *); extern int bdev_read_only(struct block_device *);
+#define HAVE_CLEAR_RDONLY_ON_PUT +#define HAVE_CLEAR_RDONLY_ON_PUT
+void dev_set_rdonly(struct block_device *bdev); +void dev_set_rdonly(struct block_device *bdev);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment