From patchwork Sat Aug 13 22:48:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 9279041 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5B5D760839 for ; Sun, 14 Aug 2016 11:23:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C56A28948 for ; Sun, 14 Aug 2016 11:23:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 41030289AA; Sun, 14 Aug 2016 11:23:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FEB228948 for ; Sun, 14 Aug 2016 11:23:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933166AbcHNLXi (ORCPT ); Sun, 14 Aug 2016 07:23:38 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:35493 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933195AbcHNLXh (ORCPT ); Sun, 14 Aug 2016 07:23:37 -0400 Received: by mail-pf0-f196.google.com with SMTP id h186so2143303pfg.2; Sun, 14 Aug 2016 04:22:16 -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:in-reply-to:references; bh=Onlv3tBUGvWfGYwZXEFThzdLdltlnAXOyNC80EXOWi8=; b=DJs7lBHk3JwclpJlZ/S2c3qZf1FAgccgtdvDX0pLGaAEj3E7oexViyWxtUlUMXmymh 6r9ms+vfxETfpvqY45ikbHPwXTGuFM+T+9l824rcxS9Mnq48nmKY7c9hG7vKZQnBGjW/ f9XBji2zlSs5KvZLd9pwHLcrncgnEf2Sl8vEUZ/jcYYr202uucJnLS4WvsIBrewtVqqL Q/SO9NOlm0G1fBe6mJMOI2Ck+Of4GY4A/DLNdOTbVPjR7fvZZ3BO5Oi6x0/SeIC6MfrV ru6MTKdOnJo/H25WSvzOxHwq7G4aGQh6eN7lKYoej64p0z1QPuxMBXJaZiJRHehV2FSy MjLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Onlv3tBUGvWfGYwZXEFThzdLdltlnAXOyNC80EXOWi8=; b=G+HohpywZZ2qOU7DBU9bcQ+eGnLxoOYBNs9Cn4R6rb8FMuWtvLx5KeKuM5juyplJRX KcbjP4gx1X5HQC69A3Sglo1XvxM/JHdqpW5TGi1/cJ78KPzqRqVxsVYJhz4KxkuV9Kme njir9bnyME5YtWjEsXwGBtC/p5Uk5IJE2Gtwb2FNvrymhnnOjGw4gEMGkAGts9zwqwd5 UbKUa92tJhub3hcgejt4GriEmQq4vN+ipwA9eS/v8/gjlMox4MhbXERZNYh4nU3Djgl5 5EJSzJCAaOzVKuK317S48/2/hhC0nQJW4nI/3u73NkqF9lKTtKLJWxljZ4Ho8mx/TSJr jkAA== X-Gm-Message-State: AEkoouvjFwdrsIPgY3sMU0RC/ncnRfABFYaIg8kVmqAik/7X9r6zBdvLjBauqMSKarEukw== X-Received: by 10.98.100.67 with SMTP id y64mr40236337pfb.84.1471128558972; Sat, 13 Aug 2016 15:49:18 -0700 (PDT) Received: from deepa-ubuntu.hsd1.ca.comcast.net (c-73-252-251-201.hsd1.ca.comcast.net. [73.252.251.201]) by smtp.gmail.com with ESMTPSA id 81sm22528007pfm.90.2016.08.13.15.49.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 13 Aug 2016 15:49:18 -0700 (PDT) From: Deepa Dinamani To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: arnd@arndb.de, tglx@linutronix.de, torvalds@linux-foundation.org, tytso@mit.edu, viro@zeniv.linux.org.uk, y2038@lists.linaro.org Subject: [PATCH v4 02/26] fs: proc: Delete inode time initializations in proc_alloc_inode() Date: Sat, 13 Aug 2016 15:48:14 -0700 Message-Id: <1471128518-24075-3-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1471128518-24075-1-git-send-email-deepa.kernel@gmail.com> References: <1471128518-24075-1-git-send-email-deepa.kernel@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP proc uses new_inode_pseudo() to allocate a new inode. This in turn calls the proc_inode_alloc() callback. But, at this point, inode is still not initialized with the super_block pointer which only happens just before alloc_inode() returns after the call to inode_init_always(). Also, the inode times are initialized again after the call to new_inode_pseudo() in proc_inode_alloc(). The assignemet in proc_alloc_inode() is redundant and also doesn't work after the current_time() api is changed to take struct inode* instead of struct *super_block. This bug was reported after current_time() was used to assign times in proc_alloc_inode(). Signed-off-by: Deepa Dinamani Reported-by: Fengguang Wu [0-day test robot] Reviewed-by: Arnd Bergmann --- fs/proc/inode.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/proc/inode.c b/fs/proc/inode.c index c1b7238..ce1f1a9 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -68,7 +68,6 @@ static struct inode *proc_alloc_inode(struct super_block *sb) ei->sysctl_entry = NULL; ei->ns_ops = NULL; inode = &ei->vfs_inode; - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; return inode; }