From patchwork Thu Oct 17 12:28:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 284181 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 503212C035B for ; Thu, 17 Oct 2013 23:29:45 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755379Ab3JQM3a (ORCPT ); Thu, 17 Oct 2013 08:29:30 -0400 Received: from mail-pd0-f172.google.com ([209.85.192.172]:46825 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754686Ab3JQM33 (ORCPT ); Thu, 17 Oct 2013 08:29:29 -0400 Received: by mail-pd0-f172.google.com with SMTP id z10so2656303pdj.3 for ; Thu, 17 Oct 2013 05:29:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id; bh=UsLDfMaAe+GpNtxQHxCf1Pl9Oskm+dswC01IuAmTpB0=; b=daTlTeZabV0mJA13zmt0Z+Q/cRkoEq4MQVlMJyyJjqPrYXwFDYh+hcr1U+rpNPO8Kv YP2CiXpYCC1QYO8c1WgOxzS4Y073bRa5q96wir3D07fI8kIwEWtXyabPjVV1FHD6dvSc bXs65Q7ussR3PGb9bwoMR9PJ5STQS9S/UZxiDVp/qSgjs+aN0hrRERAEEgE9x7QVEPTD R5XWAJiAY4UpRJAkLluZ1ADquTsMp4+8ynDumAljQc/RudeRfKg25bTVIwPppYd2N4nD 0huDLl2W1hiejaBMMDB8csDtqEJuhVjpmWuVkjFa+tvUjw7U5NSHIhAkIRF8FUDLpIZs rtcA== X-Received: by 10.68.6.170 with SMTP id c10mr8189146pba.101.1382012968492; Thu, 17 Oct 2013 05:29:28 -0700 (PDT) Received: from localhost ([183.37.244.176]) by mx.google.com with ESMTPSA id xn12sm114189695pac.12.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 17 Oct 2013 05:29:27 -0700 (PDT) From: Ming Lei To: linux-kernel@vger.kernel.org Cc: Jan Kara , Ming Lei , Ted Tso , linux-ext4@vger.kernel.org, "linux-fsdevel@vger.kernel.org" Subject: [PATCH] ext4: pair trace_ext4_writepages & trace_ext4_writepages_result Date: Thu, 17 Oct 2013 20:28:46 +0800 Message-Id: <1382012926-398-1-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Pair the two trace events to make troubeshooting writepages easier, and it should be more convinient to write a simple script to parse the traces. Cc: Ted Tso Cc: linux-ext4@vger.kernel.org Cc: "linux-fsdevel@vger.kernel.org" Cc: Jan Kara Signed-off-by: Ming Lei Reviewed-by: Lukas Czerner --- fs/ext4/inode.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 32beaa4..0ad73d4 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -2420,16 +2420,15 @@ static int ext4_writepages(struct address_space *mapping, * because that could violate lock ordering on umount */ if (!mapping->nrpages || !mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) - return 0; + goto out_writepages; if (ext4_should_journal_data(inode)) { struct blk_plug plug; - int ret; blk_start_plug(&plug); ret = write_cache_pages(mapping, wbc, __writepage, mapping); blk_finish_plug(&plug); - return ret; + goto out_writepages; } /* @@ -2442,8 +2441,10 @@ static int ext4_writepages(struct address_space *mapping, * *never* be called, so if that ever happens, we would want * the stack trace. */ - if (unlikely(sbi->s_mount_flags & EXT4_MF_FS_ABORTED)) - return -EROFS; + if (unlikely(sbi->s_mount_flags & EXT4_MF_FS_ABORTED)) { + ret = -EROFS; + goto out_writepages; + } if (ext4_should_dioread_nolock(inode)) { /*