From patchwork Mon Jan 6 18:46:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Whitney X-Patchwork-Id: 307416 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 484572C0040 for ; Tue, 7 Jan 2014 05:46:26 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755717AbaAFSqZ (ORCPT ); Mon, 6 Jan 2014 13:46:25 -0500 Received: from mail-qa0-f48.google.com ([209.85.216.48]:47015 "EHLO mail-qa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755291AbaAFSqY (ORCPT ); Mon, 6 Jan 2014 13:46:24 -0500 Received: by mail-qa0-f48.google.com with SMTP id w5so3294256qac.7 for ; Mon, 06 Jan 2014 10:46:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=AQQxRpyU/g4ansRvvaErK2O/EUz5tDbXm/+YaBossTc=; b=gZbfsMhtf9VNx9N4U07ODmY4Sgl1I8BJDnwJTKmf6zFHVOCM57yBmv+XBHYZcQAa7e 6UjOtVavoafGmGNlENVEeJaYsqXTwToV50SC8YTbYe52aqwhpR5jVoz/cXkIWpsLpSO+ cCTZ3Tb67DGPukUxAnFU6YeZ7/hBe17g6dKcY794V5KS46oted8U/IV5oiq3LO1TFKri vmwJox7s83x28x261iGABlr0hKcPg74x3JjOJ1r8IOATAaC7MHs9C/oHsQGPUJSw9qeh wX6Ti+KFZv3Z5eRs81UBxjDwSk3KAwF5b0gJllU3Oxf+9AryXHA5cFJCEDuwwlIHIFUE TZ8g== X-Received: by 10.49.110.202 with SMTP id ic10mr187352545qeb.18.1389033982581; Mon, 06 Jan 2014 10:46:22 -0800 (PST) Received: from wallace (c-75-67-250-69.hsd1.nh.comcast.net. [75.67.250.69]) by mx.google.com with ESMTPSA id e2sm91628821qas.21.2014.01.06.10.46.21 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 06 Jan 2014 10:46:22 -0800 (PST) Date: Mon, 6 Jan 2014 13:46:19 -0500 From: Eric Whitney To: linux-ext4@vger.kernel.org Cc: tytso@mit.edu Subject: [PATCH] ext4: fix bigalloc regression Message-ID: <20140106184619.GB2211@wallace> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Commit f5a44db5d2 introduced a regression on filesystems created with the bigalloc feature (cluster size > blocksize). It causes xfstests generic/006 and /013 to fail with an unexpected JBD2 failure and transaction abort that leaves the test file system in a read only state. Other xfstests run on bigalloc file systems are likely to fail as well. The cause is the accidental use of a cluster mask where a cluster offset was needed in ext4_ext_map_blocks(). Signed-off-by: Eric Whitney --- fs/ext4/extents.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 4410cc3..3384dc4 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -4218,7 +4218,7 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode, */ map->m_flags &= ~EXT4_MAP_FROM_CLUSTER; newex.ee_block = cpu_to_le32(map->m_lblk); - cluster_offset = EXT4_LBLK_CMASK(sbi, map->m_lblk); + cluster_offset = EXT4_LBLK_COFF(sbi, map->m_lblk); /* * If we are doing bigalloc, check to see if the extent returned