From patchwork Tue Apr 11 09:50:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksij Rempel X-Patchwork-Id: 749389 X-Patchwork-Delegate: richard@nod.at Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3w2MnL22nlz9s8M for ; Tue, 11 Apr 2017 19:53:26 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Bdg6HJel"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=jp2CvO592q0Hwj+I3COVbnuE5DLhbQOUgZRviH3CWrU=; b=Bdg6HJelkeXw/Hk7ynxoz/bkYJ F304kh+FeMnyIlRszO+cXxZ+dz34nzFiIfNaIx1U/4TKkFKFwz14pZxOWsnV1Zq7GdvuTDqxMoL3g 7Ht/Vwww+ne4VWh9oVyl+hsU8FxVxiuupuW0Q69+m6mq2RdDYB7QLkk6xKgXwTuXaXOPmrl0fZQVb 5BuTBrI5vD4s6OgxAcNDXeY3pnSFE8Q0TRt59pWbvHCSODGkqXYJGesFfowotOPA5UlYe9QK4VBkM UCcS4gTNYxPck3ON0IZHNb7wkDSIen6alJMm2CRaopeg+D275QifVwFt/gO3mHt+Cax3tbouR5AsM ZSI83YGQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cxsUG-0007Ra-Iz; Tue, 11 Apr 2017 09:53:24 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cxsSQ-0006Vg-Tk for linux-mtd@lists.infradead.org; Tue, 11 Apr 2017 09:51:34 +0000 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cxsS2-0002iD-3a; Tue, 11 Apr 2017 11:51:06 +0200 Received: from ore by dude.hi.pengutronix.de with local (Exim 4.88) (envelope-from ) id 1cxsS1-0008UG-3t; Tue, 11 Apr 2017 11:51:05 +0200 From: Oleksij Rempel To: richard@nod.at, dedekind1@gmail.com, adrian.hunter@intel.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH v2 2/3] fs: ubifs: update i_version on inode changes Date: Tue, 11 Apr 2017 11:50:54 +0200 Message-Id: <20170411095055.26328-3-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170411095055.26328-1-o.rempel@pengutronix.de> References: <20170411095055.26328-1-o.rempel@pengutronix.de> X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-mtd@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170411_025131_203465_A37036BC X-CRM114-Status: UNSURE ( 8.44 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Oleksij Rempel MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org increment i_version to notify security/IMA about changes made in inode. Signed-off-by: Oleksij Rempel --- fs/ubifs/file.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index d9ae86f96df7..29213724259b 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c @@ -1104,6 +1104,8 @@ static void do_attr_changes(struct inode *inode, const struct iattr *attr) mode &= ~S_ISGID; inode->i_mode = mode; } + if (IS_I_VERSION(inode)) + inode_inc_iversion(inode); } /** @@ -1401,6 +1403,9 @@ int ubifs_update_time(struct inode *inode, struct timespec *time, if (!(inode->i_sb->s_flags & MS_LAZYTIME)) iflags |= I_DIRTY_SYNC; + if (IS_I_VERSION(inode)) + inode_inc_iversion(inode); + release = ui->dirty; __mark_inode_dirty(inode, iflags); mutex_unlock(&ui->ui_mutex); @@ -1435,6 +1440,8 @@ static int update_mctime(struct inode *inode) mutex_lock(&ui->ui_mutex); inode->i_mtime = inode->i_ctime = ubifs_current_time(inode); + if (IS_I_VERSION(inode)) + inode_inc_iversion(inode); release = ui->dirty; mark_inode_dirty_sync(inode); mutex_unlock(&ui->ui_mutex); @@ -1580,6 +1587,8 @@ static int ubifs_vm_page_mkwrite(struct vm_fault *vmf) mutex_lock(&ui->ui_mutex); inode->i_mtime = inode->i_ctime = ubifs_current_time(inode); + if (IS_I_VERSION(inode)) + inode_inc_iversion(inode); release = ui->dirty; mark_inode_dirty_sync(inode); mutex_unlock(&ui->ui_mutex);