Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4800454yba; Wed, 8 May 2019 03:02:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqwTrqEJrWWWcyP3onBCoO0b5W2Aq6N+7Ml2FKZgzbY2olnHABflrufOpUpEs6zGzD6FP6zc X-Received: by 2002:a17:902:e683:: with SMTP id cn3mr45910108plb.115.1557309738083; Wed, 08 May 2019 03:02:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557309738; cv=none; d=google.com; s=arc-20160816; b=bNjLQq+XJbSIvpu3vJUGCuKPxFg64h3MU9wvSh6PvNYD12NuEl79stk8JT32uJF6sV 1aVlb46PHKuduG2DhBEwa6azaAAeXBS/1MsXnmTCN3dVF/pUj9WJixjOqN6GnKxqk5Zs Nsn58VfgQX5EZQNmmKJvPwxZnSyN5GweqofehEpuWKK3fUjBboXAaQ9Nzv5hzqv0VpMD +TzCkGfxV1BqC9rhr/9n3wm24NAJcDmnwmAkC5Zu49ZhjMayewInw5qdDAQnpSR9pIiW cZFJgpno5Nkyqq4vU9r0up2CJkBhM+WsRtahSDOU09x6oE0tTc/Toe9Cj3YmwAVxoawz RltQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=zDN869GvPb0cU9Sx6GZuFUymGKJkjof1kt2e1Xrwtg0=; b=ZBWO4oNf52Z0kotUqMNWiKEoYEcisKmW2GeURjFRrin/6kCT6LVpKiqCt76t72hbst Xemixzbxm0hSuTXpWSF1fvRi/ej9JZcMcHPX7UAV1Nf2G35U1avSQB0B4ML+o5WyqT62 IEeupQKHYJwW4rnYCEZIGxgxU98N68J00rfwga7dUwOw2TI+tzQFgSboH5YM8lV2nG31 zdz42wSkkCVNxK8TWf4N46YpQZ/z28XDRUPypJep/hue6+kXEXAtB+ICgppu2AxImyl6 vsGQgHpJe+e/AB3rkSykRqlI/6kPu5d+sxt8GjdvJbaHzfvAIGFIXEPht1YKDsnSVBZG uAXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 35si22528769pld.6.2019.05.08.03.01.50; Wed, 08 May 2019 03:02:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726760AbfEHJkW (ORCPT + 99 others); Wed, 8 May 2019 05:40:22 -0400 Received: from out30-44.freemail.mail.aliyun.com ([115.124.30.44]:40041 "EHLO out30-44.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726727AbfEHJkW (ORCPT ); Wed, 8 May 2019 05:40:22 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R211e4;CH=green;DM=||false|;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01f04446;MF=wuyihao@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0TRApRN9_1557308396; Received: from ali-186590dcce93-2.local(mailfrom:wuyihao@linux.alibaba.com fp:SMTPD_---0TRApRN9_1557308396) by smtp.aliyun-inc.com(127.0.0.1); Wed, 08 May 2019 17:39:57 +0800 Subject: Re: [PATCH 1/2] NFSv4.1: Again fix a race where CB_NOTIFY_LOCK fails to wake a waiter To: Greg KH Cc: linux-nfs@vger.kernel.org, Jeff Layton , "J. Bruce Fields" , Joseph Qi , caspar@linux.alibaba.com References: <2a1cebca-1efb-1686-475b-a581e50e61b4@linux.alibaba.com> <20190508091921.GA1968@kroah.com> From: Yihao Wu Message-ID: <2697efa4-2da8-ca0f-3ad4-bdcbbdfd334a@linux.alibaba.com> Date: Wed, 8 May 2019 17:39:59 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190508091921.GA1968@kroah.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On 2019/5/8 5:19 PM, Greg KH wrote: > On Wed, May 08, 2019 at 05:13:25PM +0800, Yihao Wu wrote: >> Commit b7dbcc0e433f ""NFSv4.1: Fix a race where CB_NOTIFY_LOCK fails >> to wake a waiter" found this bug. However it didn't fix it. This can >> be fixed by adding memory barrier pair. >> >> Specifically, if any CB_NOTIFY_LOCK should be handled between unlocking >> the wait queue and freezable_schedule_timeout, only two cases are >> possible. So CB_NOTIFY_LOCK will not be dropped unexpectly. >> >> 1. The callback thread marks the NFS client as waked. Then NFS client >> noticed that itself is waked, so it don't goes to sleep. And it cleans >> its wake mark. >> >> 2. The NFS client noticed that itself is not waked yet, so it goes to >> sleep. No modification will ever happen to the wake mark in between. >> >> Fixes: a1d617d ("nfs: allow blocking locks to be awoken by lock callbacks") >> Signed-off-by: Yihao Wu >> --- >> fs/nfs/nfs4proc.c | 21 +++++---------------- >> 1 file changed, 5 insertions(+), 16 deletions(-) > > > > This is not the correct way to submit patches for inclusion in the > stable kernel tree. Please read: > https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html > for how to do this properly. > > > Thanks for your reply! And I'm sorry about that. I will correct this in patch v2 and read the rules before sending patches. Thanks, Yihao Wu