Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3398374imm; Fri, 20 Jul 2018 16:16:22 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcWhnWMDlEilnrr6Vaxa+V7fnlJdUDx+oT6CMjdNevKjheC/sz94+cEk7+s18NIKqqxJh9F X-Received: by 2002:a62:6746:: with SMTP id b67-v6mr3992814pfc.243.1532128582675; Fri, 20 Jul 2018 16:16:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532128582; cv=none; d=google.com; s=arc-20160816; b=bcNEmqm07XKmOR2Uu7+PTt3osSMjEvqF+N616qqpXQrSyb5piLoormQELWIcUDJ1fs 5IjMaLOjK3/CxH5OPRiX/pyM3zsG15RsnfPoSiykOtF5X3clRF4ZULU5a6FhtWJblZhT G3Yrc7JUewpCk5oykCL586P3Bj8wl9GRCwtYKgkCjZWS39Ntfva5vi+KUXFjlCDnXtDI 4jyoSQcjeHDJOX5D1q6ebl3S4B7AcNKFShx4oO9hMiyCHe4+3ndRZqfqz1FtVSN/WfTd 3nhcrUZQn5rWUoMfXckLeGppWOTzAUf4UrQ8AdKSS1m/kwMWqWi93EXYvdomGbM0c79u X2Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=ByMHcxooduXou072h30djh5z0qxwCennNEnV2o6vWpA=; b=rzp9ZgEZc+TdSFHGjM9SPRB9TBGcaloKWIFzWWyWUhKettd3YTxfIMBB69G++ntQlY XzHVZ1jKjvXRSvmJoFMQhazE4w3RcEG2XUsvB2wsGd7z+Lf/LIVf2EGq7bwjFfWWT6Zm VlPOVIdtHdzXidu51ttedvftTpFWcG69DnUzmII6KrLo4BP5p8qlpkoxC2vAcJzlUyky RkKLb8PUvOAtGek3KcRjn+WPM/Gjwrw1PFkTcyRZ3Nytmm9/KTecwxGrqsyiqfWCNTQn sdyZ6mR+ygjpYMtbW/y0VGBhT/E7zXdb6t9vmBjPTb2JveB1rz9FRQKFTYfJIsPc4mQJ CUlw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a20-v6si2933930pgb.600.2018.07.20.16.15.52; Fri, 20 Jul 2018 16:16:22 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728170AbeGUAE4 (ORCPT + 99 others); Fri, 20 Jul 2018 20:04:56 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:54956 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727720AbeGUAE4 (ORCPT ); Fri, 20 Jul 2018 20:04:56 -0400 Received: from akpm3.svl.corp.google.com (unknown [104.133.9.92]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 014DCF29; Fri, 20 Jul 2018 23:14:30 +0000 (UTC) Date: Fri, 20 Jul 2018 16:14:29 -0700 From: Andrew Morton To: Jan Kara Cc: Chengguang Xu , mgorman@techsingularity.net, jlayton@redhat.com, ak@linux.intel.com, mawilcox@microsoft.com, tim.c.chen@linux.intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Al Viro Subject: Re: [PATCH] mm: adjust max read count in generic_file_buffered_read() Message-Id: <20180720161429.d63dccb9f66799dc0ff74dba@linux-foundation.org> In-Reply-To: <20180719085812.sjup2odrjyuigt3l@quack2.suse.cz> References: <20180719081726.3341-1-cgxu519@gmx.com> <20180719085812.sjup2odrjyuigt3l@quack2.suse.cz> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 19 Jul 2018 10:58:12 +0200 Jan Kara wrote: > On Thu 19-07-18 16:17:26, Chengguang Xu wrote: > > When we try to truncate read count in generic_file_buffered_read(), > > should deliver (sb->s_maxbytes - offset) as maximum count not > > sb->s_maxbytes itself. > > > > Signed-off-by: Chengguang Xu > > Looks good to me. You can add: > > Reviewed-by: Jan Kara Yup. What are the runtime effects of this bug?