Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2977678ybz; Mon, 27 Apr 2020 07:55:28 -0700 (PDT) X-Google-Smtp-Source: APiQypL5qE6ewWvlUpT9cMEv0JmuSyqrXE6gFr7Ec9aEcRe1wZELkqtaavh6wHGcnOoHRmpy1z9G X-Received: by 2002:aa7:cf0e:: with SMTP id a14mr5772679edy.188.1587999328161; Mon, 27 Apr 2020 07:55:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587999328; cv=none; d=google.com; s=arc-20160816; b=gChPJAvO3H5vTrVLUTvi+JcWU+3P4adYACZVMopp9mY9X70zrqX2rJKi+8jDfGwM7H Pmg+P47sob4uh62+pTG885JkM1GnDA7MfCH1ST8TcDUfVKRgku/7h2ecvyWkvxR9FURk lmdCvqmHtd3IBL2U1zfVEcqB7AF8lCjlhIf7Z3n8KiI/Zuv34eTu0ssGaktn5T/ZGs2C BNO18HSDXKhbiAbpzUrA5W9Z1AZJEC46AjyX+10JanMCW64BXLzk8UfBGhanGuJoZMae GSkuUrZ3oVV3mmw4k5sQ9GBgYT3DmsROELyxy+Ic2YFAXh1YPZCxCkKisR7tAKXgXuaQ UFEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=t3m+2KTR9T5PZVQTcyv++KNqgdq5KjB4WCcooGtmJYM=; b=kHMiB8uBTy4a7q+5PWTBTRI+Cu/Mok7WjrDqZrrRyn4+B7a6n0eWKEEiM9Y+wuyI1C 3cJbWKSYedXj9v5FvUyQSo2JTgQQyqkeKKUkAzKBXgSGlyKEVRxLnGNsA+PggNHm2e1k 8NQVv8iBhB1CxhmaQae11nYxkcfxL7yEG0YXGbRxKaXUjq5WxV/75CokpNrbE8xdjZoY F9RejgNbRMXdFvBWswoDPEgwYvx8Zs7odivSVQctN/8vPH1b6kj1NY9/bcLphwcdly6v j2P11+kPVp+7ZQL3izoPjLJwrujEJun9bXluEc076yYSHMnuYnS9ArHE73Yv2UjdvpgB wT5g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 35si8270109edm.560.2020.04.27.07.55.04; Mon, 27 Apr 2020 07:55:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727878AbgD0OxI (ORCPT + 99 others); Mon, 27 Apr 2020 10:53:08 -0400 Received: from verein.lst.de ([213.95.11.211]:48730 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727022AbgD0OxI (ORCPT ); Mon, 27 Apr 2020 10:53:08 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 77BBF68C7B; Mon, 27 Apr 2020 16:53:05 +0200 (CEST) Date: Mon, 27 Apr 2020 16:53:05 +0200 From: Christoph Hellwig To: Martijn Coenen Cc: axboe@kernel.dk, hch@lst.de, ming.lei@redhat.com, narayan@google.com, zezeozue@google.com, kernel-team@android.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, maco@google.com, bvanassche@acm.org, Chaitanya.Kulkarni@wdc.com, jaegeuk@kernel.org Subject: Re: [PATCH v3 1/9] loop: Factor out loop size validation Message-ID: <20200427145305.GA5490@lst.de> References: <20200427074222.65369-1-maco@android.com> <20200427074222.65369-2-maco@android.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200427074222.65369-2-maco@android.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +static int > +loop_validate_size(loff_t size) > +{ > + if ((loff_t)(sector_t)size != size) > + return -EFBIG; > + else > + return 0; Nit: no real need for an else after a return. Otherwise looks good: Reviewed-by: Christoph Hellwig