Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1396502

Re: [PATCH 1/3] md: set MD_CHANGE_PENDING in a atomic region

Path csiph.com!1.us.feeder.erje.net!feeder.erje.net!2.eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod
From Shaohua Li <shli@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 1/3] md: set MD_CHANGE_PENDING in a atomic region
Date Mon, 09 May 2016 00:20:02 +0200
Message-ID <rwFdo-77R-9@gated-at.bofh.it> (permalink)
References <ruUJA-3iX-13@gated-at.bofh.it>
X-Original-To Guoqing Jiang <gqjiang@suse.com>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.24 (2015-08-30)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 16
Organization linux.* mail to news gateway
X-Original-Cc neilb@suse.de, linux-raid@vger.kernel.org, Martin Kepplinger <martink@posteo.de>, Andrew Morton <akpm@linux-foundation.org>, Denys Vlasenko <dvlasenk@redhat.com>, Sasha Levin <sasha.levin@oracle.com>, linux-kernel@vger.kernel.org
X-Original-Date Sun, 8 May 2016 15:12:27 -0700
X-Original-Message-ID <20160508221227.GA2271@kernel.org>
X-Original-References <1462328535-22566-1-git-send-email-gqjiang@suse.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1396502

Show key headers only | View raw


On Tue, May 03, 2016 at 10:22:13PM -0400, Guoqing Jiang wrote:
> Some code waits for a metadata update by:
> 
> 1. flagging that it is needed (MD_CHANGE_DEVS or MD_CHANGE_CLEAN)
> 2. setting MD_CHANGE_PENDING and waking the management thread
> 3. waiting for MD_CHANGE_PENDING to be cleared
> 
> If the first two are done without locking, the code in md_update_sb()
> which checks if it needs to repeat might test if an update is needed
> before step 1, then clear MD_CHANGE_PENDING after step 2, resulting
> in the wait returning early.
> 
> So make sure all places that set MD_CHANGE_PENDING are atomicial, and
> bit_clear_unless (suggested by Neil) is introduced for the purpose.

Applied the 3, thanks!

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH 1/3] md: set MD_CHANGE_PENDING in a atomic region Guoqing Jiang <gqjiang@suse.com> - 2016-05-04 04:30 +0200
  Re: [PATCH 1/3] md: set MD_CHANGE_PENDING in a atomic region Shaohua Li <shli@kernel.org> - 2016-05-09 00:20 +0200

csiph-web