Bug #3893
closedlvm: incorrect flag handling
100%
Description
In lvm mirror write strategy function (mirror_write_strategy) a condition which checks for resync generated i/o is incorrect.
Following patch should fix the problem
diff u -p a/usr/src/uts/common/io/lvm/mirror/mirror.c b/usr/src/uts/common/io/lvm/mirror/mirror.c a/usr/src/uts/common/io/lvm/mirror/mirror.c
--
+++ b/usr/src/uts/common/io/lvm/mirror/mirror.c@ -4015,7 +4015,7
@ mirror_write_strategy(buf_t *pb, int fla
* completed this resync region
*/
if ((MD_MNSET_SETNO(MD_UN2SET(un))) &&
- (!flag & MD_STR_DIRTY_RD)) {
+ (!(flag & MD_STR_DIRTY_RD))) {
if (!IN_RESYNC_REGION(un, ps))
abort_write = 1;
}
Files
Updated by Prasad Joshi over 9 years ago
Copying the patch again
@ -4015,7 +4015,7 @@ mirror_write_strategy(buf_t *pb, int fla
* completed this resync region
diff -u -p a/usr/src/uts/common/io/lvm/mirror/mirror.c b/usr/src/uts/common/io/lvm/mirror/mirror.c
--- a/usr/src/uts/common/io/lvm/mirror/mirror.c
+++ b/usr/src/uts/common/io/lvm/mirror/mirror.c
*/
if ((MD_MNSET_SETNO(MD_UN2SET(un))) &&
- (!flag & MD_STR_DIRTY_RD)) {
+ (!(flag & MD_STR_DIRTY_RD))) {
if (!IN_RESYNC_REGION(un, ps))
abort_write = 1;
}
@
Updated by Prasad Joshi over 9 years ago
- File 0001-BUG-3893-lvm-fix-incorrect-mirror-strategy-flag-hand.patch 0001-BUG-3893-lvm-fix-incorrect-mirror-strategy-flag-hand.patch added
@
From 2c149996cafb19ac2a9fd81ec7f3e951037413c4 Mon Sep 17 00:00:00 2001
From: Prasad Joshi <pjoshi@stec-inc.com>
Date: Thu, 18 Jul 2013 00:07:46 +0530
Subject: [PATCH] BUG 3893: lvm: fix incorrect mirror strategy flag handling
In mirror write, if a write is after the read issued by resync thread
and the write region is not dirty. The write operation must be
aborted.
This condition is incorrectly checked in
File: usr/src/uts/common/io/lvm/mirror/mirror.c
4017 if ((MD_MNSET_SETNO(MD_UN2SET(un))) &&
4018 (!(flag & MD_STR_DIRTY_RD))) {
4019 if (!IN_RESYNC_REGION(un, ps))
4020 abort_write = 1;
4021 }
The patch fixes the problem.
Corresponding bug is: https://www.illumos.org/issues/3893
Signed-off-by: Prasad Joshi <pjoshi@stec-inc.com>
@
Updated by Dan McDonald over 9 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 100