public inbox for linux-efi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 03/92] efivarfs: update ctime when mtime changes on a write
       [not found] ` <20230705190309.579783-1-jlayton@kernel.org>
@ 2023-07-05 19:00   ` Jeff Layton
  2023-07-05 19:01   ` [PATCH v2 37/92] efivarfs: convert to ctime accessor functions Jeff Layton
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Layton @ 2023-07-05 19:00 UTC (permalink / raw)
  To: Christian Brauner, Jeremy Kerr, Ard Biesheuvel
  Cc: Al Viro, Jan Kara, linux-fsdevel, linux-kernel, linux-efi

POSIX says:

"Upon successful completion, where nbyte is greater than 0, write()
 shall mark for update the last data modification and last file status
 change timestamps of the file..."

Add the missing ctime update.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/efivarfs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/efivarfs/file.c b/fs/efivarfs/file.c
index d57ee15874f9..375576111dc3 100644
--- a/fs/efivarfs/file.c
+++ b/fs/efivarfs/file.c
@@ -51,7 +51,7 @@ static ssize_t efivarfs_file_write(struct file *file,
 	} else {
 		inode_lock(inode);
 		i_size_write(inode, datasize + sizeof(attributes));
-		inode->i_mtime = current_time(inode);
+		inode->i_mtime = inode->i_ctime = current_time(inode);
 		inode_unlock(inode);
 	}
 
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v2 37/92] efivarfs: convert to ctime accessor functions
       [not found] ` <20230705190309.579783-1-jlayton@kernel.org>
  2023-07-05 19:00   ` [PATCH v2 03/92] efivarfs: update ctime when mtime changes on a write Jeff Layton
@ 2023-07-05 19:01   ` Jeff Layton
  2023-07-06 10:57     ` Jan Kara
  1 sibling, 1 reply; 3+ messages in thread
From: Jeff Layton @ 2023-07-05 19:01 UTC (permalink / raw)
  To: Christian Brauner, Jeremy Kerr, Ard Biesheuvel
  Cc: Al Viro, Jan Kara, linux-fsdevel, linux-kernel, linux-efi

In later patches, we're going to change how the inode's ctime field is
used. Switch to using accessor functions instead of raw accesses of
inode->i_ctime.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/efivarfs/file.c  | 2 +-
 fs/efivarfs/inode.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/efivarfs/file.c b/fs/efivarfs/file.c
index 375576111dc3..59b52718a3a2 100644
--- a/fs/efivarfs/file.c
+++ b/fs/efivarfs/file.c
@@ -51,7 +51,7 @@ static ssize_t efivarfs_file_write(struct file *file,
 	} else {
 		inode_lock(inode);
 		i_size_write(inode, datasize + sizeof(attributes));
-		inode->i_mtime = inode->i_ctime = current_time(inode);
+		inode->i_mtime = inode_set_ctime_current(inode);
 		inode_unlock(inode);
 	}
 
diff --git a/fs/efivarfs/inode.c b/fs/efivarfs/inode.c
index b973a2c03dde..db9231f0e77b 100644
--- a/fs/efivarfs/inode.c
+++ b/fs/efivarfs/inode.c
@@ -25,7 +25,7 @@ struct inode *efivarfs_get_inode(struct super_block *sb,
 	if (inode) {
 		inode->i_ino = get_next_ino();
 		inode->i_mode = mode;
-		inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode);
+		inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode);
 		inode->i_flags = is_removable ? 0 : S_IMMUTABLE;
 		switch (mode & S_IFMT) {
 		case S_IFREG:
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 37/92] efivarfs: convert to ctime accessor functions
  2023-07-05 19:01   ` [PATCH v2 37/92] efivarfs: convert to ctime accessor functions Jeff Layton
@ 2023-07-06 10:57     ` Jan Kara
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Kara @ 2023-07-06 10:57 UTC (permalink / raw)
  To: Jeff Layton
  Cc: Christian Brauner, Jeremy Kerr, Ard Biesheuvel, Al Viro, Jan Kara,
	linux-fsdevel, linux-kernel, linux-efi

On Wed 05-07-23 15:01:02, Jeff Layton wrote:
> In later patches, we're going to change how the inode's ctime field is
> used. Switch to using accessor functions instead of raw accesses of
> inode->i_ctime.
> 
> Signed-off-by: Jeff Layton <jlayton@kernel.org>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  fs/efivarfs/file.c  | 2 +-
>  fs/efivarfs/inode.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/efivarfs/file.c b/fs/efivarfs/file.c
> index 375576111dc3..59b52718a3a2 100644
> --- a/fs/efivarfs/file.c
> +++ b/fs/efivarfs/file.c
> @@ -51,7 +51,7 @@ static ssize_t efivarfs_file_write(struct file *file,
>  	} else {
>  		inode_lock(inode);
>  		i_size_write(inode, datasize + sizeof(attributes));
> -		inode->i_mtime = inode->i_ctime = current_time(inode);
> +		inode->i_mtime = inode_set_ctime_current(inode);
>  		inode_unlock(inode);
>  	}
>  
> diff --git a/fs/efivarfs/inode.c b/fs/efivarfs/inode.c
> index b973a2c03dde..db9231f0e77b 100644
> --- a/fs/efivarfs/inode.c
> +++ b/fs/efivarfs/inode.c
> @@ -25,7 +25,7 @@ struct inode *efivarfs_get_inode(struct super_block *sb,
>  	if (inode) {
>  		inode->i_ino = get_next_ino();
>  		inode->i_mode = mode;
> -		inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode);
> +		inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode);
>  		inode->i_flags = is_removable ? 0 : S_IMMUTABLE;
>  		switch (mode & S_IFMT) {
>  		case S_IFREG:
> -- 
> 2.41.0
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-07-06 10:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20230705185755.579053-1-jlayton@kernel.org>
     [not found] ` <20230705190309.579783-1-jlayton@kernel.org>
2023-07-05 19:00   ` [PATCH v2 03/92] efivarfs: update ctime when mtime changes on a write Jeff Layton
2023-07-05 19:01   ` [PATCH v2 37/92] efivarfs: convert to ctime accessor functions Jeff Layton
2023-07-06 10:57     ` Jan Kara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox