Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp104372ybl; Thu, 5 Dec 2019 16:00:29 -0800 (PST) X-Google-Smtp-Source: APXvYqxgTT6G9l0UKgamTLn31uCACwoDq24/uXj0W6z8lWJd9WyevwuBeVCnOo11iu8ma+feBjqV X-Received: by 2002:aca:f445:: with SMTP id s66mr9500669oih.95.1575590429477; Thu, 05 Dec 2019 16:00:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575590429; cv=none; d=google.com; s=arc-20160816; b=p0TlAF8BWrsP5RW3ZxI6t3MU7mazp30wU/a9GNqL3/YBQ5ceoB5M1aiQj5udlPL2XJ YzF2QobTKspwm7CP9tW1wClfqT11RIYbcikw/tL+xnkbRwlduZcjMbY5eGx8WeYft6vc JllIvuKVXgqfhGgPSSeNoddCrUB27BDbynfkyKIjo37WGakARJb+KZ3znZ/+248IFsOt QE3BQgWYMeHAXi9y6U2vpuJbcUSqer9eJnLb1yY5/2wNRzyMEFT5dtbCEH5abT4SCfyV btJbCrKdEsswiLT4DDG2O3pC8ZgK3Hc79n4dqlsQKSGXA91OMqmYiD6Eo+s74jjjw+Xc 7n8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=YOmvCcAfxENDt59JmszfSJIXz70mzbpvyp0lp8vems0=; b=miPTherSdd29dm1CMLECZC9cFwKmASRQBUppE3jzdqJO8E1W3Vs/0hpxFvEIINVRg1 B4LRyttmPHXHJwyY0sMBs+T62yG0eUaAqi4Ulq6WPKX7FeDdhLJjx6ifv5oATv1kxCmg llBMfj6dD23SWzZnFdbXEGvZkTNpb3hZ2SqxXyp35xvJcgelhY5UF9GPgGAIUCbw3A7E pbgKGQS4K4EYnG8Q5aYBxqLC0i3gQhv/T2rn3yTE2QQVuLPGd7d0SW6AwWswrv8d2sDr RToGLcjp/g3Ha+ODt/gsBbidVtoqiECqKbc2Qbv81tTEJtpkIuSyNlOK6+fODxSI4yFj 3kIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Ekqfj+O7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l204si5928767oig.31.2019.12.05.16.00.17; Thu, 05 Dec 2019 16:00:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Ekqfj+O7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726233AbfLEX6u (ORCPT + 99 others); Thu, 5 Dec 2019 18:58:50 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:43635 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725926AbfLEX6u (ORCPT ); Thu, 5 Dec 2019 18:58:50 -0500 Received: by mail-lf1-f65.google.com with SMTP id 9so3833684lfq.10 for ; Thu, 05 Dec 2019 15:58:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YOmvCcAfxENDt59JmszfSJIXz70mzbpvyp0lp8vems0=; b=Ekqfj+O7irTIS0InDutPgmPnBQgrHSMkEmzAiT7Q5ixN8sawn5JY5nEfE6Oii4Oz21 eg8kbdw3ISdBN9bt9ycolPwJGycujLH+hx+x0SsfOArbXB3ywkfyL8hmA/Q4oD21fDZW LbmSPC6Jzcv6AttAaWv0ZEvqDReE3MinNrjeI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YOmvCcAfxENDt59JmszfSJIXz70mzbpvyp0lp8vems0=; b=JYSWsrR8D4wXyZgZdn9beegQNoS6YTPSYKRRjHe1xEIbBcN7VfoI8Bsx7HrHX3iysj mG5YpIhFVqQP6DvrQuBNsS7ZwpqKmR5udJDIsRj+pvfGts3E6gAES+AFN5tl+gueoC33 9CZisIRW2AQ07viit4ASb54NEsgSmYIR5XFHuaLkaWyCgZN4rpfNHARrr3S6gS64Y0WU k7mqONUxvcLrgU0OqKeGVWtkgRzKKdfbU8baNGoZ314mkezOF0zsItrjhQ7CvUg5q7hx ItpcdIbeL+cTu6psaTXn+ig8tf6X8WYZHTO9N4S+MqJC4Y4pck6gRexOhZCicBz/stS/ JNQQ== X-Gm-Message-State: APjAAAWmAHRKvgfuEmMc7QjRUrJ5ntbcXTfj77cYLcdHU8Zp+7NUWj5p 80HtjiyXQKBz/65L/5MD8if9GP7YJaY= X-Received: by 2002:a19:7401:: with SMTP id v1mr6459994lfe.129.1575590327814; Thu, 05 Dec 2019 15:58:47 -0800 (PST) Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com. [209.85.208.169]) by smtp.gmail.com with ESMTPSA id b190sm5636686lfd.39.2019.12.05.15.58.46 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Dec 2019 15:58:47 -0800 (PST) Received: by mail-lj1-f169.google.com with SMTP id e10so5613631ljj.6 for ; Thu, 05 Dec 2019 15:58:46 -0800 (PST) X-Received: by 2002:a05:651c:239:: with SMTP id z25mr4684297ljn.48.1575590326630; Thu, 05 Dec 2019 15:58:46 -0800 (PST) MIME-Version: 1.0 References: <157558502272.10278.8718685637610645781.stgit@warthog.procyon.org.uk> <157558503716.10278.17734879104574600890.stgit@warthog.procyon.org.uk> In-Reply-To: <157558503716.10278.17734879104574600890.stgit@warthog.procyon.org.uk> From: Linus Torvalds Date: Thu, 5 Dec 2019 15:58:30 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/2] pipe: Fix missing mask update after pipe_wait() [ver #2] To: David Howells Cc: Eric Biggers , Al Viro , linux-fsdevel , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 5, 2019 at 2:30 PM David Howells wrote: > > - struct pipe_buffer *buf = &pipe->bufs[(head - 1) & mask]; > + struct pipe_buffer *buf = > + &pipe->bufs[(head - 1) & (pipe->ring_size - 1)]; I changed the two occurrences of this to use a local temporary "mask" variable, to avoid the long lines. It's no longer _caching_ the value, but it makes the code more legible. Linus