Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759066AbcCVKvM (ORCPT ); Tue, 22 Mar 2016 06:51:12 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:57015 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758842AbcCVKnO (ORCPT ); Tue, 22 Mar 2016 06:43:14 -0400 From: Luis Henriques To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: Eryu Guan , "Theodore Ts'o" , Luis Henriques Subject: [PATCH 3.16.y-ckt 130/142] ext4: iterate over buffer heads correctly in move_extent_per_page() Date: Tue, 22 Mar 2016 10:40:59 +0000 Message-Id: <1458643271-4227-131-git-send-email-luis.henriques@canonical.com> In-Reply-To: <1458643271-4227-1-git-send-email-luis.henriques@canonical.com> References: <1458643271-4227-1-git-send-email-luis.henriques@canonical.com> X-Extended-Stable: 3.16 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1175 Lines: 33 3.16.7-ckt26 -stable review patch. If anyone has any objections, please let me know. ---8<------------------------------------------------------------ From: Eryu Guan commit 6ffe77bad545f4a7c8edd2a4ee797ccfcd894ab4 upstream. In commit bcff24887d00 ("ext4: don't read blocks from disk after extents being swapped") bh is not updated correctly in the for loop and wrong data has been written to disk. generic/324 catches this on sub-page block size ext4. Fixes: bcff24887d00 ("ext4: don't read blocks from disk after extentsbeing swapped") Signed-off-by: Eryu Guan Signed-off-by: Theodore Ts'o Signed-off-by: Luis Henriques --- fs/ext4/move_extent.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c index 146f8cd627b2..2423b0068183 100644 --- a/fs/ext4/move_extent.c +++ b/fs/ext4/move_extent.c @@ -1037,6 +1037,7 @@ data_copy: *err = ext4_get_block(orig_inode, orig_blk_offset + i, bh, 0); if (*err < 0) break; + bh = bh->b_this_page; } if (!*err) *err = block_commit_write(pagep[0], from, from + replaced_size);