Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5647326ybe; Tue, 17 Sep 2019 11:14:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqyRVc/qq9kthFDxuInqEpo+iOn6px/qKnZzNiDwYUwHqLyKcJt1CplkWEbep66knv0A2e8O X-Received: by 2002:a50:e04b:: with SMTP id g11mr6229839edl.302.1568744048112; Tue, 17 Sep 2019 11:14:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568744048; cv=none; d=google.com; s=arc-20160816; b=VZQtr8q0iTKOZVHry/tHVJ65T7z2nhENir35acLMKWPCi3S43ltuFuWxUKdhsSy+uz Q4tSeFSCDRz+ddjsiUmDylZMTtBlHD4gGbVRA/5RvyxMj/HRnTa/esvcVxQKKMsonK84 4txHs96LyZ3D3nhprK0BdtGvnQLKZtMUcPCSSyxiBu6CN361y1tmUBkGhoyRTVg4cDXN ECTtM8CqkwpfDlePTeE1IZ5VlaWcoArevcE8lKOOip7vDQzEuRegpHFvS6hJa+m+5mNn G8T61B2A7ZV/oKpaHDZnHe8v8Wof2S0yaWPVwDRUvU6qMhV7qPOitRHUFRckjFFd3/J5 yluA== 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=6C1BBlsKqY2aiO2+u/Cl6fZdGU1p8z91hPwtINRpwpc=; b=o+4jJsRp1YSRWCKxeuXeE2EUKWlEFK5NyRUifYA84zHTecZ/9/+IfS34WYDg0z7CfA s3Orxz61Mij+0tl9oWQt1Ko4jEBeSxY/Nao6ekYdZrDTPD9q96K57HdpxxnGLb1czI1f 2bmqTTwlneV1EDBF2auz45QrnXF/nhtfJ2glQ5LidWLosUj74m85iWIpfYlVNQtNcyjm DcZgg4K5OiAR3WcCJg+m7hXpyXdlUCuMF1RjpL6MIhXzvk7RoR2nL4pQhHQFqDFcjRgf S5YM0Mtvcb3ezrmAxVHqHEX0InKtL8mFCFHT8YNW/pZMrSAV3PRz3DYlVjxOuf54TsuD VMew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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 q28si1776859eda.322.2019.09.17.11.13.42; Tue, 17 Sep 2019 11:14:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-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-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729417AbfIQPb7 (ORCPT + 99 others); Tue, 17 Sep 2019 11:31:59 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:60656 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726882AbfIQPb7 (ORCPT ); Tue, 17 Sep 2019 11:31:59 -0400 Received: from callcc.thunk.org (guestnat-104-133-0-98.corp.google.com [104.133.0.98] (may be forged)) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id x8HFVeKC021438 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2019 11:31:41 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id 20F03420811; Tue, 17 Sep 2019 11:31:40 -0400 (EDT) Date: Tue, 17 Sep 2019 11:31:40 -0400 From: "Theodore Y. Ts'o" To: yangerkun Cc: jack@suse.cz, linux-ext4@vger.kernel.org, yi.zhang@huawei.com, houtao1@huawei.com Subject: Re: [PATCH] ext4: fix a bug in ext4_wait_for_tail_page_commit Message-ID: <20190917153140.GF6762@mit.edu> References: <20190917084814.40370-1-yangerkun@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190917084814.40370-1-yangerkun@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Sep 17, 2019 at 04:48:14PM +0800, yangerkun wrote: > No need to wait when offset equals to 0. And it will trigger a bug since > the latter __ext4_journalled_invalidatepage can free the buffers but leave > page still dirty. That's only true if the block size == the page size, no? If the offset is zero and the block size is 1k, we still need to wait. Shouldn't the better fix be: > - if (offset > PAGE_SIZE - i_blocksize(inode)) > + if (offset >= PAGE_SIZE - i_blocksize(inode)) - Ted