Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp331119imm; Mon, 9 Jul 2018 02:33:48 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfGpxG81jC3lNuOfNHeAaVo/5MFQWWkgT4Zlmapi6kGqkRjqkLaZ/OVkfTXspGsZmd1kpD/ X-Received: by 2002:a62:2c46:: with SMTP id s67-v6mr20129715pfs.153.1531128828760; Mon, 09 Jul 2018 02:33:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531128828; cv=none; d=google.com; s=arc-20160816; b=G6PLzvhYqqOIZt2okMjxj6UHhzfry45pGXlSKSv2NHNm380Y/d3Fv1T5ZOtF/b7O1+ CPRnUN6kIiYv1BEh2G147qgF/m5t+jO7asJuowsgwt7NCea51jqIkU+9oq7LFOZEEGK5 pUKgtNkszwcc1ilF3w+02X87X4ZfEzw3spR9JLI1UI/ye+9jTe/lwUIz17toHKueLQ4v Nlbd6E7Io+jRQPwxzQQXoG7IgTo1jMAr8YPrAEszrz6lL3589D0dcJQfbzgkEarzSl3A 8h26EvlHZxjJce/ABHMIVU+h6amuqgxtnnal34U04vLp4FsSmuFMvbarIvZslyzbBzpo 3Qmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:content-id:mime-version :subject:cc:to:references:in-reply-to:from:organization :arc-authentication-results; bh=pmHry1LBIA6VmKy2v4Ze1N9PLk9XvGYsGR0yncFWgBA=; b=ZiPcJ221oF+Q67mgMohbPw7PeuSBSnit8W5ANKjanMRGW9Gz61lVl0PpNzSEs2H8xf Br45LQYht5gVQiOJDJ1+umZW9NCHTmjDnl6i/z/dhvz0KUxFInMEhX3VHhtw/LUpiEj9 WycBgrNXnVivklK+FTrsfc+7+Wm8dheWJfDxCLOi3OyGTzrgA5fNhMG/hPok6VzIXOLX SSfQwXDxaGCoKgE/HYa+1ynA5s2NyZtL3O+zg2MPHLy3wODLE7mNwjb6fg9mzuTuiUNO skk7aSaJmmaRuBqe6EbEmqX2AQR52fz3SyjcAiwqm7r7Im2dV1dIY7/Yswzl2Ow3vt+i Lr8w== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a1-v6si2762205pgq.387.2018.07.09.02.33.34; Mon, 09 Jul 2018 02:33:48 -0700 (PDT) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932753AbeGIJc5 (ORCPT + 99 others); Mon, 9 Jul 2018 05:32:57 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:49262 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932466AbeGIJc4 (ORCPT ); Mon, 9 Jul 2018 05:32:56 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 85269DFE1; Mon, 9 Jul 2018 09:32:55 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-149.rdu2.redhat.com [10.10.120.149]) by smtp.corp.redhat.com (Postfix) with ESMTP id AFB732156889; Mon, 9 Jul 2018 09:32:54 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20180708210154.10423-4-ebiggers3@gmail.com> References: <20180708210154.10423-4-ebiggers3@gmail.com> <20180708210154.10423-1-ebiggers3@gmail.com> To: Eric Biggers Cc: dhowells@redhat.com, Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Eric Biggers Subject: Re: [PATCH 03/18] fs_context: fix detecting full log buffer MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <10669.1531128774.1@warthog.procyon.org.uk> Date: Mon, 09 Jul 2018 10:32:54 +0100 Message-ID: <10670.1531128774@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 09 Jul 2018 09:32:55 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 09 Jul 2018 09:32:55 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dhowells@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Eric Biggers wrote: > When 'head' and 'tail' wrap around, 'log->head - log->tail' will be > something like '4 - 252 = -248', and comparing that directly to the > array size is wrong. Fix by casting to 'u8'. I think a better fix is to use CIRC_CNT() or CIRC_SPACE(). David