From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zeniv.linux.org.uk ([195.92.253.2]:40234 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754110AbcLNVPr (ORCPT ); Wed, 14 Dec 2016 16:15:47 -0500 Date: Wed, 14 Dec 2016 21:15:19 +0000 From: Al Viro To: Linus Torvalds Cc: Joseph Salisbury , fangwei1@huawei.com, Christoph Hellwig , Dave Chinner , "stable@vger.kernel.org" , Andrew Morton Subject: Re: [v4.9 Regression] vfs,mm: fix a dead loop in truncate_inode_pages_range() Message-ID: <20161214211519.GP1555@ZenIV.linux.org.uk> References: <2e0624ac-c0be-de61-d54d-1c1ce39358ae@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: stable-owner@vger.kernel.org List-ID: On Wed, Dec 14, 2016 at 12:27:41PM -0800, Linus Torvalds wrote: > diff --git a/mm/filemap.c b/mm/filemap.c > index 69568388c699..b06517b7f97f 100644 > --- a/mm/filemap.c > +++ b/mm/filemap.c > @@ -1637,7 +1637,7 @@ static ssize_t do_generic_file_read(struct file *filp, loff_t *ppos, > int error = 0; > > if (unlikely(*ppos >= inode->i_sb->s_maxbytes)) > - return -EINVAL; > + return 0; > iov_iter_truncate(iter, inode->i_sb->s_maxbytes); BTW, shouldn't we truncate to *ppos - inode->i_sb->s_maxbytes here as well?