Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1619669 > unrolled thread

[PATCH v1 2/3] fs: ubifs: i_version on inode changes

Started byOleksij Rempel <o.rempel@pengutronix.de>
First post2017-04-10 09:00 +0200
Last post2017-04-10 13:50 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v1 2/3] fs: ubifs: i_version on inode changes Oleksij Rempel <o.rempel@pengutronix.de> - 2017-04-10 09:00 +0200
    Re: [PATCH v1 2/3] fs: ubifs: i_version on inode changes Oleksij Rempel <ore@pengutronix.de> - 2017-04-10 09:50 +0200
      Re: [PATCH v1 2/3] fs: ubifs: i_version on inode changes Richard Weinberger <richard@nod.at> - 2017-04-10 13:50 +0200

#1619669 — [PATCH v1 2/3] fs: ubifs: i_version on inode changes

FromOleksij Rempel <o.rempel@pengutronix.de>
Date2017-04-10 09:00 +0200
Subject[PATCH v1 2/3] fs: ubifs: i_version on inode changes
Message-ID<tuBsR-5Eh-9@gated-at.bofh.it>
From: Sascha Hauer <s.hauer@pengutronix.de>

This is necessary for IMA/EVM to detect changes on inodes.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 fs/ubifs/dir.c   | 8 --------
 fs/ubifs/file.c  | 2 ++
 fs/ubifs/super.c | 3 +--
 3 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
index 30825d882aa9..4a300bfabf9b 100644
--- a/fs/ubifs/dir.c
+++ b/fs/ubifs/dir.c
@@ -111,14 +111,6 @@ struct inode *ubifs_new_inode(struct ubifs_info *c, struct inode *dir,
 	if (!inode)
 		return ERR_PTR(-ENOMEM);
 
-	/*
-	 * Set 'S_NOCMTIME' to prevent VFS form updating [mc]time of inodes and
-	 * marking them dirty in file write path (see 'file_update_time()').
-	 * UBIFS has to fully control "clean <-> dirty" transitions of inodes
-	 * to make budgeting work.
-	 */
-	inode->i_flags |= S_NOCMTIME;
-
 	inode_init_owner(inode, dir, mode);
 	inode->i_mtime = inode->i_atime = inode->i_ctime =
 			 ubifs_current_time(inode);
diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c
index d9ae86f96df7..3cbc662ce160 100644
--- a/fs/ubifs/file.c
+++ b/fs/ubifs/file.c
@@ -1391,6 +1391,8 @@ int ubifs_update_time(struct inode *inode, struct timespec *time,
 		return err;
 
 	mutex_lock(&ui->ui_mutex);
+	if (flags & S_VERSION)
+		inode_inc_iversion(inode);
 	if (flags & S_ATIME)
 		inode->i_atime = *time;
 	if (flags & S_CTIME)
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 61180bee38b4..76e44ab88065 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -128,9 +128,8 @@ struct inode *ubifs_iget(struct super_block *sb, unsigned long inum)
 	if (err)
 		goto out_ino;
 
-	inode->i_flags |= S_NOCMTIME;
 #ifndef CONFIG_UBIFS_ATIME_SUPPORT
-	inode->i_flags |= S_NOATIME;
+	inode->i_flags |= S_NOATIME | S_NOCMTIME;
 #endif
 	set_nlink(inode, le32_to_cpu(ino->nlink));
 	i_uid_write(inode, le32_to_cpu(ino->uid));
-- 
2.11.0

[toc] | [next] | [standalone]


#1619693

FromOleksij Rempel <ore@pengutronix.de>
Date2017-04-10 09:50 +0200
Message-ID<tuCfg-6dm-17@gated-at.bofh.it>
In reply to#1619669
please ignore this patch. It need to be updated.

On 04/10/2017 08:53 AM, Oleksij Rempel wrote:
> From: Sascha Hauer <s.hauer@pengutronix.de>
>
> This is necessary for IMA/EVM to detect changes on inodes.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
>  fs/ubifs/dir.c   | 8 --------
>  fs/ubifs/file.c  | 2 ++
>  fs/ubifs/super.c | 3 +--
>  3 files changed, 3 insertions(+), 10 deletions(-)
>
> diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
> index 30825d882aa9..4a300bfabf9b 100644
> --- a/fs/ubifs/dir.c
> +++ b/fs/ubifs/dir.c
> @@ -111,14 +111,6 @@ struct inode *ubifs_new_inode(struct ubifs_info *c, struct inode *dir,
>  	if (!inode)
>  		return ERR_PTR(-ENOMEM);
>
> -	/*
> -	 * Set 'S_NOCMTIME' to prevent VFS form updating [mc]time of inodes and
> -	 * marking them dirty in file write path (see 'file_update_time()').
> -	 * UBIFS has to fully control "clean <-> dirty" transitions of inodes
> -	 * to make budgeting work.
> -	 */
> -	inode->i_flags |= S_NOCMTIME;
> -
>  	inode_init_owner(inode, dir, mode);
>  	inode->i_mtime = inode->i_atime = inode->i_ctime =
>  			 ubifs_current_time(inode);
> diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c
> index d9ae86f96df7..3cbc662ce160 100644
> --- a/fs/ubifs/file.c
> +++ b/fs/ubifs/file.c
> @@ -1391,6 +1391,8 @@ int ubifs_update_time(struct inode *inode, struct timespec *time,
>  		return err;
>
>  	mutex_lock(&ui->ui_mutex);
> +	if (flags & S_VERSION)
> +		inode_inc_iversion(inode);
>  	if (flags & S_ATIME)
>  		inode->i_atime = *time;
>  	if (flags & S_CTIME)
> diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
> index 61180bee38b4..76e44ab88065 100644
> --- a/fs/ubifs/super.c
> +++ b/fs/ubifs/super.c
> @@ -128,9 +128,8 @@ struct inode *ubifs_iget(struct super_block *sb, unsigned long inum)
>  	if (err)
>  		goto out_ino;
>
> -	inode->i_flags |= S_NOCMTIME;
>  #ifndef CONFIG_UBIFS_ATIME_SUPPORT
> -	inode->i_flags |= S_NOATIME;
> +	inode->i_flags |= S_NOATIME | S_NOCMTIME;
>  #endif
>  	set_nlink(inode, le32_to_cpu(ino->nlink));
>  	i_uid_write(inode, le32_to_cpu(ino->uid));
>

[toc] | [prev] | [next] | [standalone]


#1619849

FromRichard Weinberger <richard@nod.at>
Date2017-04-10 13:50 +0200
Message-ID<tuFZv-68-7@gated-at.bofh.it>
In reply to#1619693
Am 10.04.2017 um 09:48 schrieb Oleksij Rempel:
> please ignore this patch. It need to be updated.

Okay. :-)
Please CC also linux-fsdevel.

Thanks,
//richard

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web