From patchwork Wed Nov 23 09:15:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yongqiang Yang X-Patchwork-Id: 127279 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id D02A81007D2 for ; Wed, 23 Nov 2011 22:48:33 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752246Ab1KWLsc (ORCPT ); Wed, 23 Nov 2011 06:48:32 -0500 Received: from mail-iy0-f174.google.com ([209.85.210.174]:54225 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751985Ab1KWLsb (ORCPT ); Wed, 23 Nov 2011 06:48:31 -0500 Received: by iage36 with SMTP id e36so1471959iag.19 for ; Wed, 23 Nov 2011 03:48:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; bh=gQq2Nd5ZgtzSAdvIPBHzrLbdjdE1JLrhgBATRsMh3qk=; b=jlppqgUwBgQkaSdxJ1cVoMXMLZ4IiHJqLjr+gD23Wuf/FeHYbUfYnFHf9gCaxpYDfR AbQDPbkPHVWWOvQnTfIhRr6ZwtK7F+zcjjxzUunjkcgmgrbbG4mW+EusJdBw+mz7uQNE VmCDC+Ym1lk9yBb9SqPicUni56OaS1k9YN+mQ= Received: by 10.42.150.135 with SMTP id a7mr2426218icw.53.1322048911165; Wed, 23 Nov 2011 03:48:31 -0800 (PST) Received: from localhost.localdomain ([159.226.43.42]) by mx.google.com with ESMTPS id dd36sm72558080ibb.7.2011.11.23.03.48.27 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 23 Nov 2011 03:48:29 -0800 (PST) From: Yongqiang Yang To: linux-ext4@vger.kernel.org Cc: achender@linux.vnet.ibm.com, tytso@mit.edu, Yongqiang Yang Subject: [PATCH 1/2] ext4: let mpage_submit_io works well when blocksize < pagesize Date: Wed, 23 Nov 2011 17:15:25 +0800 Message-Id: <1322039726-3587-1-git-send-email-xiaoqiangnk@gmail.com> X-Mailer: git-send-email 1.7.5.1 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org If there is a unwritten but clean buffer in a page and there is a dirty buffer after the buffer, then mpage_submit_io does not write the dirty buffer out. As a result, da_writepages loops forever. This patch fixes the problem by checking dirty flag. Signed-off-by: Yongqiang Yang --- fs/ext4/inode.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 755f6c7..20a1d17 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -1339,8 +1339,11 @@ static int mpage_da_submit_io(struct mpage_da_data *mpd, clear_buffer_unwritten(bh); } - /* skip page if block allocation undone */ - if (buffer_delay(bh) || buffer_unwritten(bh)) + /* + * skip page if block allocation undone and + * block is dirty + */ + if (ext4_bh_delay_or_unwritten(NULL, bh)) skip_page = 1; bh = bh->b_this_page; block_start += bh->b_size;