aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/bitmap.c6
-rw-r--r--drivers/md/dm-log-userspace-transfer.c2
-rw-r--r--drivers/md/dm-log.c8
-rw-r--r--drivers/md/dm-mpath.c22
-rw-r--r--drivers/md/md.c2
5 files changed, 19 insertions, 21 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index ca203cb23f3c..5c9362792f1d 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -854,7 +854,7 @@ static void bitmap_file_set_bit(struct bitmap *bitmap, sector_t block)
854 if (bitmap->flags & BITMAP_HOSTENDIAN) 854 if (bitmap->flags & BITMAP_HOSTENDIAN)
855 set_bit(bit, kaddr); 855 set_bit(bit, kaddr);
856 else 856 else
857 ext2_set_bit(bit, kaddr); 857 __test_and_set_bit_le(bit, kaddr);
858 kunmap_atomic(kaddr, KM_USER0); 858 kunmap_atomic(kaddr, KM_USER0);
859 PRINTK("set file bit %lu page %lu\n", bit, page->index); 859 PRINTK("set file bit %lu page %lu\n", bit, page->index);
860 } 860 }
@@ -1050,7 +1050,7 @@ static int bitmap_init_from_disk(struct bitmap *bitmap, sector_t start)
1050 if (bitmap->flags & BITMAP_HOSTENDIAN) 1050 if (bitmap->flags & BITMAP_HOSTENDIAN)
1051 b = test_bit(bit, paddr); 1051 b = test_bit(bit, paddr);
1052 else 1052 else
1053 b = ext2_test_bit(bit, paddr); 1053 b = test_bit_le(bit, paddr);
1054 kunmap_atomic(paddr, KM_USER0); 1054 kunmap_atomic(paddr, KM_USER0);
1055 if (b) { 1055 if (b) {
1056 /* if the disk bit is set, set the memory bit */ 1056 /* if the disk bit is set, set the memory bit */
@@ -1226,7 +1226,7 @@ void bitmap_daemon_work(mddev_t *mddev)
1226 clear_bit(file_page_offset(bitmap, j), 1226 clear_bit(file_page_offset(bitmap, j),
1227 paddr); 1227 paddr);
1228 else 1228 else
1229 ext2_clear_bit(file_page_offset(bitmap, j), 1229 __test_and_clear_bit_le(file_page_offset(bitmap, j),
1230 paddr); 1230 paddr);
1231 kunmap_atomic(paddr, KM_USER0); 1231 kunmap_atomic(paddr, KM_USER0);
1232 } else 1232 } else
diff --git a/drivers/md/dm-log-userspace-transfer.c b/drivers/md/dm-log-userspace-transfer.c
index 049eaf12aaab..1f23e048f077 100644
--- a/drivers/md/dm-log-userspace-transfer.c
+++ b/drivers/md/dm-log-userspace-transfer.c
@@ -134,7 +134,7 @@ static void cn_ulog_callback(struct cn_msg *msg, struct netlink_skb_parms *nsp)
134{ 134{
135 struct dm_ulog_request *tfr = (struct dm_ulog_request *)(msg + 1); 135 struct dm_ulog_request *tfr = (struct dm_ulog_request *)(msg + 1);
136 136
137 if (!cap_raised(nsp->eff_cap, CAP_SYS_ADMIN)) 137 if (!cap_raised(current_cap(), CAP_SYS_ADMIN))
138 return; 138 return;
139 139
140 spin_lock(&receiving_list_lock); 140 spin_lock(&receiving_list_lock);
diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c
index 6951536ea29c..57968eb382c1 100644
--- a/drivers/md/dm-log.c
+++ b/drivers/md/dm-log.c
@@ -251,20 +251,20 @@ struct log_c {
251 */ 251 */
252static inline int log_test_bit(uint32_t *bs, unsigned bit) 252static inline int log_test_bit(uint32_t *bs, unsigned bit)
253{ 253{
254 return ext2_test_bit(bit, (unsigned long *) bs) ? 1 : 0; 254 return test_bit_le(bit, (unsigned long *) bs) ? 1 : 0;
255} 255}
256 256
257static inline void log_set_bit(struct log_c *l, 257static inline void log_set_bit(struct log_c *l,
258 uint32_t *bs, unsigned bit) 258 uint32_t *bs, unsigned bit)
259{ 259{
260 ext2_set_bit(bit, (unsigned long *) bs); 260 __test_and_set_bit_le(bit, (unsigned long *) bs);
261 l->touched_cleaned = 1; 261 l->touched_cleaned = 1;
262} 262}
263 263
264static inline void log_clear_bit(struct log_c *l, 264static inline void log_clear_bit(struct log_c *l,
265 uint32_t *bs, unsigned bit) 265 uint32_t *bs, unsigned bit)
266{ 266{
267 ext2_clear_bit(bit, (unsigned long *) bs); 267 __test_and_clear_bit_le(bit, (unsigned long *) bs);
268 l->touched_dirtied = 1; 268 l->touched_dirtied = 1;
269} 269}
270 270
@@ -740,7 +740,7 @@ static int core_get_resync_work(struct dm_dirty_log *log, region_t *region)
740 return 0; 740 return 0;
741 741
742 do { 742 do {
743 *region = ext2_find_next_zero_bit( 743 *region = find_next_zero_bit_le(
744 (unsigned long *) lc->sync_bits, 744 (unsigned long *) lc->sync_bits,
745 lc->region_count, 745 lc->region_count,
746 lc->sync_search); 746 lc->sync_search);
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index b82d28819e2a..4b0b63c290a6 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -1283,24 +1283,22 @@ static int do_end_io(struct multipath *m, struct request *clone,
1283 if (!error && !clone->errors) 1283 if (!error && !clone->errors)
1284 return 0; /* I/O complete */ 1284 return 0; /* I/O complete */
1285 1285
1286 if (error == -EOPNOTSUPP) 1286 if (error == -EOPNOTSUPP || error == -EREMOTEIO)
1287 return error;
1288
1289 if (clone->cmd_flags & REQ_DISCARD)
1290 /*
1291 * Pass all discard request failures up.
1292 * FIXME: only fail_path if the discard failed due to a
1293 * transport problem. This requires precise understanding
1294 * of the underlying failure (e.g. the SCSI sense).
1295 */
1296 return error; 1287 return error;
1297 1288
1298 if (mpio->pgpath) 1289 if (mpio->pgpath)
1299 fail_path(mpio->pgpath); 1290 fail_path(mpio->pgpath);
1300 1291
1301 spin_lock_irqsave(&m->lock, flags); 1292 spin_lock_irqsave(&m->lock, flags);
1302 if (!m->nr_valid_paths && !m->queue_if_no_path && !__must_push_back(m)) 1293 if (!m->nr_valid_paths) {
1303 r = -EIO; 1294 if (!m->queue_if_no_path) {
1295 if (!__must_push_back(m))
1296 r = -EIO;
1297 } else {
1298 if (error == -EBADE)
1299 r = error;
1300 }
1301 }
1304 spin_unlock_irqrestore(&m->lock, flags); 1302 spin_unlock_irqrestore(&m->lock, flags);
1305 1303
1306 return r; 1304 return r;
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 1876761f1828..06ecea751a39 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -7357,7 +7357,7 @@ static int __init md_init(void)
7357{ 7357{
7358 int ret = -ENOMEM; 7358 int ret = -ENOMEM;
7359 7359
7360 md_wq = alloc_workqueue("md", WQ_RESCUER, 0); 7360 md_wq = alloc_workqueue("md", WQ_MEM_RECLAIM, 0);
7361 if (!md_wq) 7361 if (!md_wq)
7362 goto err_wq; 7362 goto err_wq;
7363 7363