Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E60AC43381 for ; Tue, 12 Mar 2019 12:40:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 19E77214D8 for ; Tue, 12 Mar 2019 12:40:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=kroah.com header.i=@kroah.com header.b="LSFR5JDk"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="fRIkGyEX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725895AbfCLMku (ORCPT ); Tue, 12 Mar 2019 08:40:50 -0400 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:38871 "EHLO wout2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725774AbfCLMku (ORCPT ); Tue, 12 Mar 2019 08:40:50 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 4F5413502; Tue, 12 Mar 2019 08:40:49 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 12 Mar 2019 08:40:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=UeuKOS33DTUhX8iVSXVQ1Hr5nA3 niT+HngheJndOATQ=; b=LSFR5JDkXdYo4EgkO/NAuqOwhnLoREHi1/C9DiEijRK 12JsYCDSTSGRupCj/snk4ttY/cXss+9Ig98sDhrD+2LFYpO7D3rG5y7bY8JBOwdh /13tushKap/E+SMHbi+p2CJl+CeOVpsI+71WzXFKj4Fi82tcn9vkAATNUaZP+T74 g3tShJTe936J2QliuyLTxrykTRsi8ZNogQ8SDuPKfG0NvDp1Vjpw47XQEnD7ELug khX4oKc4LzBPoDvqx0Zi3d+9E7lTXcOV2Q4p5zoRS40YA6IAbpypNlgiiSXPWSk0 JedzbDJHOna5RfekpCvqEL1NH+rxfPTvke7RkEDzA2g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=UeuKOS 33DTUhX8iVSXVQ1Hr5nA3niT+HngheJndOATQ=; b=fRIkGyEXw3zs5OmPNlGz1Q P+aoI+M6gOhElVdPegHo6CXNoWwG2z/aYQpsBlP32d5DCCFs2EfCkoI0J0wmYYRh je4rQMqJbElsxmjDT2Aou2GTfWIM1HZULYdJc87NRm9tLVWH0+F+Y6rBM2y8LkWZ QTstZJpRZ6aluh76CmHctydwYdA4JZVsouzi7BFDAN3yFTtvuIcNGrg80P6khZ1/ yNgLpwIf9dpVi3SFHlE13AIW4n83eUXyo5mgFMcIClOzySadLjWVtetFNJWwRr9p sWohkgxSA2NMRP1cJ9/DUxmEur++X2nJxKVpzaRHTzzU0My2pa2QH9N8EA1uSx6g == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrgeekgdegfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujggfsehttdertddtredvnecuhfhrohhmpefirhgvghcu mffjuceoghhrvghgsehkrhhorghhrdgtohhmqeenucfkphepuddvrddvjedrieehrddvvd dunecurfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvgheskhhrohgrhhdrtghomhenucev lhhushhtvghrufhiiigvpedu X-ME-Proxy: Received: from localhost (unknown [12.27.65.221]) by mail.messagingengine.com (Postfix) with ESMTPA id 05D9A10335; Tue, 12 Mar 2019 08:40:47 -0400 (EDT) Date: Tue, 12 Mar 2019 05:40:47 -0700 From: Greg KH To: Andreas Gruenbacher Cc: stable@vger.kernel.org, Mark Syms , Bob Peterson Subject: Re: [PATCH] gfs2: Fix missed wakeups in find_insert_glock Message-ID: <20190312124047.GB14713@kroah.com> References: <20190311095244.10998-1-agruenba@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190311095244.10998-1-agruenba@redhat.com> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Mon, Mar 11, 2019 at 10:52:44AM +0100, Andreas Gruenbacher wrote: > commit 605b0487f0bc1ae9963bf52ece0f5c8055186f81 upstream. > > Mark Syms has reported seeing tasks that are stuck waiting in > find_insert_glock. It turns out that struct lm_lockname contains four padding > bytes on 64-bit architectures that function glock_waitqueue doesn't skip when > hashing the glock name. As a result, we can end up waking up the wrong > waitqueue, and the waiting tasks may be stuck forever. > > Fix that by using ht_parms.key_len instead of sizeof(struct lm_lockname) for > the key length. > > Reported-by: Mark Syms > Signed-off-by: Andreas Gruenbacher > Signed-off-by: Bob Peterson > Cc: stable@vger.kernel.org # v4.14+ > --- > fs/gfs2/glock.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c > index f66773c71bcde..d32964cd11176 100644 > --- a/fs/gfs2/glock.c > +++ b/fs/gfs2/glock.c > @@ -107,7 +107,7 @@ static int glock_wake_function(wait_queue_entry_t *wait, unsigned int mode, > > static wait_queue_head_t *glock_waitqueue(struct lm_lockname *name) > { > - u32 hash = jhash2((u32 *)name, sizeof(*name) / 4, 0); > + u32 hash = jhash2((u32 *)name, ht_parms.key_len / 4, 0); > > return glock_wait_table + hash_32(hash, GLOCK_WAIT_TABLE_BITS); > } > -- > 2.20.1 > Now queued up, thanks. greg k-h