Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1212439iog; Sat, 18 Jun 2022 03:50:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sWsWxdvmFaoIHboc88B2JgkeB7NOe4DWm6EE387eaTMpAtzoIQy1Lr3l4zGi1lE6a0C/rn X-Received: by 2002:a05:6a00:22cf:b0:51c:11c2:4bb with SMTP id f15-20020a056a0022cf00b0051c11c204bbmr14675222pfj.54.1655549424498; Sat, 18 Jun 2022 03:50:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655549424; cv=none; d=google.com; s=arc-20160816; b=Y8o26pUozRzxAZDRn5ut+1u7bHUhFZJ9a3ql0S2lXMTQrj+cA7u4L9cSucX+9/gnjK FpXdQbGLQzdhqmMpiiGElJk5hSCc+ok0QimrajsiWUxliwjP39sYAUPO5CQpxe2g9cHZ KtaS0xMPf985Qc8Clt0taWJU52qNJV6hCYx0vcmo21sgv2diwW3a8rsHxs0RYlF52lcu hrHDum1pio3sEBOw/Yx4Ilu5qT7uQGUEgfSiMqo6ownBQdzzj3BQNuJlzne5wSVKCCcv EEM0shdJW/BAElAvjWSsauvK2Wtq35a1OjVo4ss1xTNOmpZJBiNru3O/AGXQZTX6LWCq IM5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=XDQYopvY+n0JyKPmW0NgGxfaIg7ptxNKbg5tiL90yf4=; b=KKB7AmnUaFmuZ4bWu22ODqApzQJwHc6Ly36abfW09ETbFras4YrEFgCSVHTbda29Lk 9Uqf/5XsLpj9hFh+EbigXtaZqvgewpAKo7LPCcgCGFe4zpvSoTCem/msgCeGHv0Xgxge RkwIQX/syyqb01oJwvkrBMtNjHwkeBRSbjvmOmRYTwByd5BnGk6r/oG1bjnQOjEVI2kN kx2Un/EqIstdOaCXafCGxXdVO5z2Emcmzn/iMsteiAFGok2USAgKLYRqOWRnXW6FeXzD dCu1Xev4W+m0aagqm1vG+ayymUK4o3K819iiQsSTaM6fVPF16ZA1iQMUy3cxTkBQCJk6 oFYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=f52cnHOz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q10-20020a170902f78a00b0016a0529c312si5058835pln.142.2022.06.18.03.50.00; Sat, 18 Jun 2022 03:50:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=f52cnHOz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231329AbiFRKet (ORCPT + 99 others); Sat, 18 Jun 2022 06:34:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229721AbiFRKes (ORCPT ); Sat, 18 Jun 2022 06:34:48 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D5B8DFE4; Sat, 18 Jun 2022 03:34:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=XDQYopvY+n0JyKPmW0NgGxfaIg7ptxNKbg5tiL90yf4=; b=f52cnHOzcNZsJ0dPtfJpa6RtMC 6cP9oGvpz505NKdQXmMUHHLJ5qHC+ZAmqtqiD5S65X3Kzi3/mNGc/vFA25eufTyu5/lbr8/mnhuAG 8h3kNgjkFHZLHFKCfYqXcuErKGMyyWJHdusPX6hD2v+ByRt0wAjOK+wnTIseQ1AniycFdoVOt5KmH +0PcfgAQH5upv5nR+RmIKc9fTZR5QdFEjagK/l15tLu4Oo5mzHyt8253KvcK0M+c7Cun96AnmW/4S HKOQWIlNWJpyr05ItQjfOxN7CAeEAM6ekhpvt8qa977OjiJ+ab+1NsKEehjbHHfnfsGRT6Zw21LWx rFAKvIog==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1o2Vmr-003d2E-4c; Sat, 18 Jun 2022 10:34:41 +0000 Date: Sat, 18 Jun 2022 11:34:41 +0100 From: Matthew Wilcox To: Miaohe Lin Cc: akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] filemap: obey mapping->invalidate_lock lock/unlock order Message-ID: References: <20220618083820.35626-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220618083820.35626-1-linmiaohe@huawei.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 18, 2022 at 04:38:20PM +0800, Miaohe Lin wrote: > The invalidate_locks of two mappings should be unlocked in reverse order > relative to the locking order in filemap_invalidate_lock_two(). Modifying Why? It's perfectly valid to lock(A) lock(B) unlock(A) unlock(B). If it weren't we'd have lockdep check it and complain.