From patchwork Fri Jun 23 04:47:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Theodore Ts'o X-Patchwork-Id: 779766 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 3wv5XS5NBkz9s7g for ; Fri, 23 Jun 2017 14:47:20 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=thunk.org header.i=@thunk.org header.b="jW9dMvGz"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751240AbdFWErU (ORCPT ); Fri, 23 Jun 2017 00:47:20 -0400 Received: from imap.thunk.org ([74.207.234.97]:34816 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751171AbdFWErT (ORCPT ); Fri, 23 Jun 2017 00:47:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=thunk.org; s=ef5046eb; h=Message-Id:Date:Subject:Cc:To:From; bh=P1xHSPVEnhUX9r5rIeuDJZgs1rwXNjalCBiRbpr4wdA=; b=jW9dMvGzG639Bf+oNzilrEzSl99t5KISMRkXlYgu2ZaivzgPkezpVEeinl9z/TktldBxegVrtvBrpeg+K2fRP6iwyzvBhGWYexqo153fYDFSZGjixoRC7WXYgrbEQLStrUMhEjyLQwC6WLnSI1CVT8nuj7nZrKkxSqGikq7lXIk=; Received: from root (helo=callcc.thunk.org) by imap.thunk.org with local-esmtp (Exim 4.84_2) (envelope-from ) id 1dOGV5-0002cw-1K; Fri, 23 Jun 2017 04:47:19 +0000 Received: by callcc.thunk.org (Postfix, from userid 15806) id 46FF1C04800; Fri, 23 Jun 2017 00:47:18 -0400 (EDT) From: Theodore Ts'o To: Ext4 Developers List Cc: Theodore Ts'o Subject: [PATCH] ext4: return EFSBADCRC if a bad checksum error is found in ext4_find_entry() Date: Fri, 23 Jun 2017 00:47:16 -0400 Message-Id: <20170623044716.12850-1-tytso@mit.edu> X-Mailer: git-send-email 2.11.0.rc0.7.gbe5a750 X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Previously a bad directory block with a bad checksum is skipped; we should be returning EFSBADCRC (aka EBADMSG). Signed-off-by: Theodore Ts'o --- fs/ext4/namei.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 2a7f2dc7f4dd..13f0cadb1238 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -1456,7 +1456,8 @@ static struct buffer_head * ext4_find_entry (struct inode *dir, EXT4_ERROR_INODE(dir, "checksumming directory " "block %lu", (unsigned long)block); brelse(bh); - goto next; + ret = ERR_PTR(-EFSBADCRC); + goto cleanup_and_exit; } set_buffer_verified(bh); i = search_dirblock(bh, dir, &fname,