From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753507AbdK0Tgn (ORCPT ); Mon, 27 Nov 2017 14:36:43 -0500 Received: from mail-qk0-f194.google.com ([209.85.220.194]:38757 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752734AbdK0Tgl (ORCPT ); Mon, 27 Nov 2017 14:36:41 -0500 X-Google-Smtp-Source: AGs4zMbeSwAPaTJImMp17DKFh8XlhR3tl3NQRzCJCMdxIbVRwaGP8mXjURqcWNo701F7l42RYaZ8zA== Date: Mon, 27 Nov 2017 11:36:37 -0800 From: Tejun Heo To: Rasmus Villemoes Cc: Arjan van de Ven , stable@vger.kernel.org, Lai Jiangshan , linux-kernel@vger.kernel.org Subject: Re: [PATCH] Revert "async: simplify lowest_in_progress()" Message-ID: <20171127193637.GK983427@devbig577.frc2.facebook.com> References: <20171120225147.3880-1-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171120225147.3880-1-linux@rasmusvillemoes.dk> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 20, 2017 at 11:51:47PM +0100, Rasmus Villemoes wrote: > This reverts commit 92266d6ef60c2381c980c6cdcb2a5c1667b36b49, which > was simply wrong: In the case where domain is NULL, we now use the > wrong offsetof() in the list_first_entry macro, so we don't actually > fetch the ->cookie value, but rather the eight bytes located > sizeof(struct list_head) further into the struct async_entry. > > On 64 bit, that's the data member, while on 32 bit, we get a u64 built > from func and data in some order. > > I think the bug happens to be harmless in practice: It obviously only > affects callers which pass a NULL domain, and AFAICT the only such > caller is > > async_synchronize_full() -> > async_synchronize_full_domain(NULL) -> > async_synchronize_cookie_domain(ASYNC_COOKIE_MAX, NULL) > > and the ASYNC_COOKIE_MAX means that in practice we end up waiting for > the async_global_pending list to be empty - but it would break if > somebody happened to pass (void*)-1 as the data element to > async_schedule, and of course also if somebody ever does a > async_synchronize_cookie_domain(, NULL) with a "finite" cookie value. > > Cc: stable@vger.kernel.org # 3.10+ > Signed-off-by: Rasmus Villemoes Ughh... indeed. Acked-by: Tejun Heo Sorry about that. Can you please resend the patch w/ Andrew Morton cc'd? I think it'd be best to route this through -mm. Thanks. -- tejun