Project

General

Profile

Bug #3893

lvm: incorrect flag handling

Added by Prasad Joshi almost 6 years ago. Updated almost 6 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
kernel
Start date:
2013-07-17
Due date:
% Done:

100%

Estimated time:
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;
}


Files

History

#1

Updated by Prasad Joshi almost 6 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 almost 6 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 almost 6 years ago

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

Also available in: Atom PDF