From patchwork Wed Jun 14 11:22:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 775741 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 3wnkkz621Vz9s5L for ; Wed, 14 Jun 2017 21:22:51 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="tqVWrQ3X"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751771AbdFNLWn (ORCPT ); Wed, 14 Jun 2017 07:22:43 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:52378 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750756AbdFNLWm (ORCPT ); Wed, 14 Jun 2017 07:22:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Message-Id:Date:Subject:To:From: Sender:Reply-To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=1Nd5gbQyoNEIBKXMNM4Nu4XsSLygUvDmrdPg6BOcbnE=; b=tqVWrQ3XdyQraezGjdA/tPtEv yGaMcrgRDmFi8Q/qxw8dg2WYUFRIhSj+COErfjeRkqoRRY36lJkPY4EoqphWWkcJ6C8TTPNqpKLse fTdjO9AYNDI3TTIKTqauo78A79zVXNEy56m1fJqoPUdlRSXTQsWrkiCz4H7GKQRJF998skBrT+VAu YqMh+8uAbDSBYYp5SA/y7A8PNwXnZHN2MnAOk2kDunFOyp0oH7uEIb1HBB2sDapfrXtv4OiLflv2C Qm1Yka23/wLfGh+zvhlzpGK1ccv4iGYkNoI8KWNpXqrOUk/qJMU6puSN4oIdDLsiv0ud5AB4M+Au8 FlsNQ1pBw==; Received: from clnet-p099-196.ikbnet.co.at ([83.175.99.196] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1dL6Nl-0000py-FF for linux-ext4@vger.kernel.org; Wed, 14 Jun 2017 11:22:42 +0000 From: Christoph Hellwig To: linux-ext4@vger.kernel.org Subject: [PATCH] ext4: remove timebomb in ext4_decode_extra_time() Date: Wed, 14 Jun 2017 13:22:38 +0200 Message-Id: <20170614112238.14121-1-hch@lst.de> X-Mailer: git-send-email 2.11.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Changing behavior based on the version code is a timebomb waiting to happen, and not easily bisectable. Drop it and leave any removal to explicit developer action. (And I don't think file system should _ever_ remove backwards compatibility that has no explicit flag, but I'll leave that to the ext4 folks). Signed-off-by: Christoph Hellwig Reviewed-by: Eric Biggers --- fs/ext4/ext4.h | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 32191548abed..d35749e7cf9f 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -838,21 +838,15 @@ static inline void ext4_decode_extra_time(struct timespec *time, __le32 extra) { if (unlikely(sizeof(time->tv_sec) > 4 && (extra & cpu_to_le32(EXT4_EPOCH_MASK)))) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,20,0) + /* Handle legacy encoding of pre-1970 dates with epoch - * bits 1,1. We assume that by kernel version 4.20, - * everyone will have run fsck over the affected - * filesystems to correct the problem. (This - * backwards compatibility may be removed before this - * time, at the discretion of the ext4 developers.) + * bits 1,1. (This backwards compatibility may be removed + * at the discretion of the ext4 developers.) */ u64 extra_bits = le32_to_cpu(extra) & EXT4_EPOCH_MASK; if (extra_bits == 3 && ((time->tv_sec) & 0x80000000) != 0) extra_bits = 0; time->tv_sec += extra_bits << 32; -#else - time->tv_sec += (u64)(le32_to_cpu(extra) & EXT4_EPOCH_MASK) << 32; -#endif } time->tv_nsec = (le32_to_cpu(extra) & EXT4_NSEC_MASK) >> EXT4_EPOCH_BITS; }