Bug #3893

lvm: incorrect flag handling

Added by Prasad Joshi about 4 years ago. Updated about 4 years ago.

Status:ResolvedStart date:2013-07-17
Priority:NormalDue date:
Assignee:Prasad Joshi% Done:

100%

Category:kernel
Target version:-
Difficulty:Bite-size Tags:needs-triage

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;
}

0001-BUG-3893-lvm-fix-incorrect-mirror-strategy-flag-hand.patch Magnifier - The patch which fixes the problem (1.46 KB) Prasad Joshi, 2013-07-17 06:57 PM

0001-BUG-3893-lvm-fix-incorrect-mirror-strategy-flag-hand.patch Magnifier - Reattching the patch (1.46 KB) Prasad Joshi, 2013-07-17 06:59 PM

History

#1 Updated by Prasad Joshi about 4 years ago

Copying the patch again


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;
}
@

#3 Updated by Prasad Joshi about 4 years ago

@
From 2c149996cafb19ac2a9fd81ec7f3e951037413c4 Mon Sep 17 00:00:00 2001
From: Prasad Joshi <>
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 <>
@

#4 Updated by Dan McDonald about 4 years ago

  • % Done changed from 0 to 100
  • Status changed from New to Resolved

Also available in: Atom