]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
mdadm/r5cache: allow adding journal to array without journal
authorSong Liu <songliubraving@fb.com>
Tue, 28 Mar 2017 18:04:44 +0000 (11:04 -0700)
committerJes Sorensen <jsorensen@fb.com>
Wed, 2 Aug 2017 13:22:51 +0000 (09:22 -0400)
Currently, --add-journal can be only used to recreate broken journal
for arrays with journal since  creation. As the kernel code getting
more mature, this constraint is no longer necessary.

This patch allows --add-journal to add journal to array without
journal.

Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Manage.c
mdadm.8.in

index 04b9398c2e4f1e76587de518966b0d557b9688ba..b82a7293f0f14da0398236690e07442a4c46ef0a 100644 (file)
--- a/Manage.c
+++ b/Manage.c
@@ -911,7 +911,6 @@ int Manage_add(int fd, int tfd, struct mddev_dev *dv,
 
        /* only add journal to array that supports journaling */
        if (dv->disposition == 'j') {
-               struct mdinfo mdi;
                struct mdinfo *mdp;
 
                mdp = sysfs_read(fd, NULL, GET_ARRAY_STATE);
@@ -928,11 +927,6 @@ int Manage_add(int fd, int tfd, struct mddev_dev *dv,
 
                sysfs_free(mdp);
 
-               tst->ss->getinfo_super(tst, &mdi, NULL);
-               if (mdi.journal_device_required == 0) {
-                       pr_err("%s does not support journal device.\n", devname);
-                       return -1;
-               }
                disc.raid_disk = 0;
        }
 
index ecfe9da8d4748e7e5997586c52c3f1aede607b6a..461c5de103cc94fa5eddb44be3cc38ea2193e38b 100644 (file)
@@ -1526,9 +1526,8 @@ the device is found or <slot>:missing in case the device is not found.
 
 .TP
 .BR \-\-add-journal
-Recreate journal for RAID-4/5/6 array that lost a journal device. In the
-current implementation, this command cannot add a journal to an array
-that had a failed journal. To avoid interrupting on-going write opertions,
+Add journal to an existing array, or recreate journal for RAID-4/5/6 array
+that lost a journal device. To avoid interrupting on-going write opertions,
 .B \-\-add-journal
 only works for array in Read-Only state.