Skip to content

Commit b139a98

Browse files
committed
Merge: RHEL9.7 MDRAID - 2nd Update to the latest upstream
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/6621 JIRA: https://issues.redhat.com/browse/RHEL-83988 Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=67074892 Upstream Status: commits are found in Linus's git tree Upstream Status: RHEL-Only Omitted-Fix: e8a7824 Signed-off-by: Nigel Croxon <[email protected]> Approved-by: Vladis Dronov <[email protected]> Approved-by: Xiao Ni <[email protected]> Approved-by: Heinz Mauelshagen <[email protected]> Approved-by: CKI KWF Bot <[email protected]> Merged-by: Augusto Caringi <[email protected]>
2 parents 1d29b1e + de9f00d commit b139a98

File tree

20 files changed

+430
-412
lines changed

20 files changed

+430
-412
lines changed

crypto/async_tx/async_xor.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -389,32 +389,6 @@ async_xor_val_offs(struct page *dest, unsigned int offset,
389389
}
390390
EXPORT_SYMBOL_GPL(async_xor_val_offs);
391391

392-
/**
393-
* async_xor_val - attempt a xor parity check with a dma engine.
394-
* @dest: destination page used if the xor is performed synchronously
395-
* @src_list: array of source pages
396-
* @offset: offset in pages to start transaction
397-
* @src_cnt: number of source pages
398-
* @len: length in bytes
399-
* @result: 0 if sum == 0 else non-zero
400-
* @submit: submission / completion modifiers
401-
*
402-
* honored flags: ASYNC_TX_ACK
403-
*
404-
* src_list note: if the dest is also a source it must be at index zero.
405-
* The contents of this array will be overwritten if a scribble region
406-
* is not specified.
407-
*/
408-
struct dma_async_tx_descriptor *
409-
async_xor_val(struct page *dest, struct page **src_list, unsigned int offset,
410-
int src_cnt, size_t len, enum sum_check_flags *result,
411-
struct async_submit_ctl *submit)
412-
{
413-
return async_xor_val_offs(dest, offset, src_list, NULL, src_cnt,
414-
len, result, submit);
415-
}
416-
EXPORT_SYMBOL_GPL(async_xor_val);
417-
418392
MODULE_AUTHOR("Intel Corporation");
419393
MODULE_DESCRIPTION("asynchronous xor/xor-zero-sum api");
420394
MODULE_LICENSE("GPL");

drivers/md/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ config MD_BITMAP_FILE
5858
actually sitting on the MD device.
5959

6060
config MD_LINEAR
61-
tristate "Linear (append) mode (deprecated)"
61+
tristate "Linear (append) mode"
6262
depends on BLK_DEV_MD
6363
help
6464
If you say Y here, then your multiple devices driver will be able to

drivers/md/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ dm-zoned-y += dm-zoned-target.o dm-zoned-metadata.o dm-zoned-reclaim.o
2929

3030
md-mod-y += md.o md-bitmap.o
3131
raid456-y += raid5.o raid5-cache.o raid5-ppl.o
32-
linear-y += md-linear.o
3332
multipath-y += md-multipath.o
3433
faulty-y += md-faulty.o
34+
linear-y += md-linear.o
3535

3636
# Note: link order is important. All raid personalities
37-
# and must come before md.o, as they each initialise
38-
# themselves, and md.o may use the personalities when it
37+
# and must come before md.o, as they each initialise
38+
# themselves, and md.o may use the personalities when it
3939
# auto-initialised.
4040

4141
obj-$(CONFIG_MD_LINEAR) += linear.o

drivers/md/md-bitmap.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@
2929
#include <linux/buffer_head.h>
3030
#include <linux/seq_file.h>
3131
#include <trace/events/block.h>
32+
3233
#include "md.h"
3334
#include "md-bitmap.h"
35+
#include "md-cluster.h"
3436

3537
#define BITMAP_MAJOR_LO 3
3638
/* version 4 insists the bitmap is in little-endian order
@@ -426,8 +428,8 @@ static int __write_sb_page(struct md_rdev *rdev, struct bitmap *bitmap,
426428
struct block_device *bdev;
427429
struct mddev *mddev = bitmap->mddev;
428430
struct bitmap_storage *store = &bitmap->storage;
429-
unsigned int bitmap_limit = (bitmap->storage.file_pages - pg_index) <<
430-
PAGE_SHIFT;
431+
unsigned long num_pages = bitmap->storage.file_pages;
432+
unsigned int bitmap_limit = (num_pages - pg_index % num_pages) << PAGE_SHIFT;
431433
loff_t sboff, offset = mddev->bitmap_info.offset;
432434
sector_t ps = pg_index * PAGE_SIZE / SECTOR_SIZE;
433435
unsigned int size = PAGE_SIZE;
@@ -436,7 +438,7 @@ static int __write_sb_page(struct md_rdev *rdev, struct bitmap *bitmap,
436438

437439
bdev = (rdev->meta_bdev) ? rdev->meta_bdev : rdev->bdev;
438440
/* we compare length (page numbers), not page offset. */
439-
if ((pg_index - store->sb_index) == store->file_pages - 1) {
441+
if ((pg_index - store->sb_index) == num_pages - 1) {
440442
unsigned int last_page_size = store->bytes & (PAGE_SIZE - 1);
441443

442444
if (last_page_size == 0)
@@ -942,7 +944,7 @@ static int md_bitmap_read_sb(struct bitmap *bitmap)
942944
bmname(bitmap), err);
943945
goto out_no_sb;
944946
}
945-
bitmap->cluster_slot = md_cluster_ops->slot_number(bitmap->mddev);
947+
bitmap->cluster_slot = bitmap->mddev->cluster_ops->slot_number(bitmap->mddev);
946948
goto re_read;
947949
}
948950

@@ -2021,7 +2023,7 @@ static void md_bitmap_free(void *data)
20212023
sysfs_put(bitmap->sysfs_can_clear);
20222024

20232025
if (mddev_is_clustered(bitmap->mddev) && bitmap->mddev->cluster_info &&
2024-
bitmap->cluster_slot == md_cluster_ops->slot_number(bitmap->mddev))
2026+
bitmap->cluster_slot == bitmap->mddev->cluster_ops->slot_number(bitmap->mddev))
20252027
md_cluster_stop(bitmap->mddev);
20262028

20272029
/* Shouldn't be needed - but just in case.... */
@@ -2229,7 +2231,7 @@ static int bitmap_load(struct mddev *mddev)
22292231
mddev_create_serial_pool(mddev, rdev);
22302232

22312233
if (mddev_is_clustered(mddev))
2232-
md_cluster_ops->load_bitmaps(mddev, mddev->bitmap_info.nodes);
2234+
mddev->cluster_ops->load_bitmaps(mddev, mddev->bitmap_info.nodes);
22332235

22342236
/* Clear out old bitmap info first: Either there is none, or we
22352237
* are resuming after someone else has possibly changed things,

drivers/md/md-cluster.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,7 @@ static int resize_bitmaps(struct mddev *mddev, sector_t newsize, sector_t oldsiz
11661166
struct dlm_lock_resource *bm_lockres;
11671167
char str[64];
11681168

1169-
if (i == md_cluster_ops->slot_number(mddev))
1169+
if (i == slot_number(mddev))
11701170
continue;
11711171

11721172
bitmap = mddev->bitmap_ops->get_from_slot(mddev, i);
@@ -1216,7 +1216,7 @@ static int resize_bitmaps(struct mddev *mddev, sector_t newsize, sector_t oldsiz
12161216
*/
12171217
static int cluster_check_sync_size(struct mddev *mddev)
12181218
{
1219-
int current_slot = md_cluster_ops->slot_number(mddev);
1219+
int current_slot = slot_number(mddev);
12201220
int node_num = mddev->bitmap_info.nodes;
12211221
struct dlm_lock_resource *bm_lockres;
12221222
struct md_bitmap_stats stats;
@@ -1612,7 +1612,14 @@ static int gather_bitmaps(struct md_rdev *rdev)
16121612
return err;
16131613
}
16141614

1615-
static const struct md_cluster_operations cluster_ops = {
1615+
static struct md_cluster_operations cluster_ops = {
1616+
.head = {
1617+
.type = MD_CLUSTER,
1618+
.id = ID_CLUSTER,
1619+
.name = "cluster",
1620+
.owner = THIS_MODULE,
1621+
},
1622+
16161623
.join = join,
16171624
.leave = leave,
16181625
.slot_number = slot_number,
@@ -1642,13 +1649,12 @@ static int __init cluster_init(void)
16421649
{
16431650
pr_warn("md-cluster: support raid1 and raid10 (limited support)\n");
16441651
pr_info("Registering Cluster MD functions\n");
1645-
register_md_cluster_operations(&cluster_ops, THIS_MODULE);
1646-
return 0;
1652+
return register_md_submodule(&cluster_ops.head);
16471653
}
16481654

16491655
static void cluster_exit(void)
16501656
{
1651-
unregister_md_cluster_operations();
1657+
unregister_md_submodule(&cluster_ops.head);
16521658
}
16531659

16541660
module_init(cluster_init);

drivers/md/md-cluster.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ struct mddev;
1010
struct md_rdev;
1111

1212
struct md_cluster_operations {
13+
struct md_submodule_head head;
14+
1315
int (*join)(struct mddev *mddev, int nodes);
1416
int (*leave)(struct mddev *mddev);
1517
int (*slot_number)(struct mddev *mddev);
@@ -35,4 +37,8 @@ struct md_cluster_operations {
3537
void (*update_size)(struct mddev *mddev, sector_t old_dev_sectors);
3638
};
3739

40+
extern int md_setup_cluster(struct mddev *mddev, int nodes);
41+
extern void md_cluster_stop(struct mddev *mddev);
42+
extern void md_reload_sb(struct mddev *mddev, int raid_disk);
43+
3844
#endif /* _MD_CLUSTER_H */

drivers/md/md-faulty.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
#define MaxFault 50
5656
#include <linux/blkdev.h>
5757
#include <linux/module.h>
58-
#include <linux/raid/md_u.h>
5958
#include <linux/slab.h>
6059
#include "md.h"
6160
#include <linux/seq_file.h>
@@ -350,9 +349,13 @@ static void faulty_free(struct mddev *mddev, void *priv)
350349

351350
static struct md_personality faulty_personality =
352351
{
353-
.name = "faulty",
354-
.level = LEVEL_FAULTY,
355-
.owner = THIS_MODULE,
352+
.head = {
353+
.type = MD_PERSONALITY,
354+
.id = ID_FAULTY,
355+
.name = "faulty",
356+
.owner = THIS_MODULE,
357+
},
358+
356359
.make_request = faulty_make_request,
357360
.run = faulty_run,
358361
.free = faulty_free,
@@ -363,12 +366,12 @@ static struct md_personality faulty_personality =
363366

364367
static int __init raid_init(void)
365368
{
366-
return register_md_personality(&faulty_personality);
369+
return register_md_submodule(&faulty_personality.head);
367370
}
368371

369372
static void raid_exit(void)
370373
{
371-
unregister_md_personality(&faulty_personality);
374+
unregister_md_submodule(&faulty_personality.head);
372375
}
373376

374377
module_init(raid_init);

0 commit comments

Comments
 (0)