Re: [PATCH] multipathd: revert mpp size update if map update fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Oh yes. Applied.
Thanks.


On Fri, Oct 25, 2013 at 2:50 AM, <michaelc@xxxxxxxxxxx> wrote:
From: Mike Christie <michaelc@xxxxxxxxxxx>

If updating the dm device in the kernel fails we cannot leave
the mpp size updated, because if we correct the problem and
try to resize later multipathd prevents resizing the device
of the size has not changed.

I hit this when all paths to a dm-multipath device where not
yet updated but multipathd resize was run.

Signed-off-by: Mike Christie <michaelc@xxxxxxxxxxx>
---
 multipathd/cli_handlers.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c
index 4b860bb..58a5643 100644
--- a/multipathd/cli_handlers.c
+++ b/multipathd/cli_handlers.c
@@ -567,6 +567,7 @@ int resize_map(struct multipath *mpp, unsigned long long size,
               struct vectors * vecs)
 {
        char params[PARAMS_SIZE] = {0};
+       unsigned long long orig_size = mpp->size;

        mpp->size = size;
        update_mpp_paths(mpp, vecs->pathvec);
@@ -575,6 +576,7 @@ int resize_map(struct multipath *mpp, unsigned long long size,
        if (domap(mpp, params) <= 0) {
                condlog(0, "%s: failed to resize map : %s", mpp->alias,
                        strerror(errno));
+               mpp->size = orig_size;
                return 1;
        }
        return 0;
--
1.7.1


--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel

[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux