From patchwork Fri Aug 15 06:42:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chintzung cheng X-Patchwork-Id: 380094 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 D0E3C140088 for ; Fri, 15 Aug 2014 16:44:55 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751729AbaHOGok (ORCPT ); Fri, 15 Aug 2014 02:44:40 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:41798 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751245AbaHOGok (ORCPT ); Fri, 15 Aug 2014 02:44:40 -0400 Received: by mail-pa0-f44.google.com with SMTP id eu11so3006453pac.17 for ; Thu, 14 Aug 2014 23:44:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=aUtWdP7buXEsrCpUn1zjgnd2gJzLPrwahuunFcC4PFs=; b=fezJXm9vi9XuLrs5aAJR6nksPaDONfV2t2TTjgAvepkVDPna1pzjpSDb4q1kjt9jrz d/Fwra/K+QqhZqWGCdjxJ4F8kbLNS6izVmjTJWGcGFRquCFDPjLpX+Fdvzx9PjSv8cXD 4fHaGJad0fudYXVWZfwvmdY9cLIAdvrjKIOcK2IpzvPJEj5US9x5G5TpZLFhYP/dNcr1 mcQeIm+b2sdN4wNXyC6GhYSkPoJox+tytS3RUFDZjemAcy4ReQF0/VAdfxsZg8HH7otS /e2wCEaCRpXuebZb+qGuUz8t+OFbYqcAQQvufRlQGrzVWb3cMFuhlwX7iEWSnZ9XiHxd LOrQ== X-Received: by 10.66.90.229 with SMTP id bz5mr9627670pab.80.1408085078544; Thu, 14 Aug 2014 23:44:38 -0700 (PDT) Received: from localhost.localdomain ([202.39.79.13]) by mx.google.com with ESMTPSA id zf5sm24824440pac.41.2014.08.14.23.44.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Aug 2014 23:44:37 -0700 (PDT) From: Chin-Tsung Cheng To: tytso@mit.edu Cc: adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, Chin-Tsung Cheng Subject: [PATCH v2] ext4: include journal blocks of internal journal in df overhead calcs Date: Fri, 15 Aug 2014 14:42:51 +0800 Message-Id: <1408084971-1456-1-git-send-email-chintzung@gmail.com> X-Mailer: git-send-email 1.9.3 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org The journal blocks of external journal device should not be counted as overhead. Signed-off-by: Chin-Tsung Cheng --- fs/ext4/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 32b43ad..a80b122 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3316,8 +3316,8 @@ int ext4_calculate_overhead(struct super_block *sb) memset(buf, 0, PAGE_SIZE); cond_resched(); } - /* Add the journal blocks as well */ - if (sbi->s_journal) + /* Add the internal journal blocks as well */ + if (sbi->s_journal && !sbi->journal_bdev) overhead += EXT4_NUM_B2C(sbi, sbi->s_journal->j_maxlen); sbi->s_overhead = overhead;