public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: update i_version in update_dev_time
@ 2023-06-15 12:49 Jeff Layton
  2023-06-19 15:38 ` David Sterba
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Layton @ 2023-06-15 12:49 UTC (permalink / raw)
  To: Chris Mason, Josef Bacik, David Sterba; +Cc: linux-btrfs, linux-kernel

When updating the ctime, we also want to update i_version.

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

This is just something I noticed by inspection. There is probably no way
to test this today unless you can somehow get to this inode via nfsd.
Still, I think it's the right thing to do for consistency's sake.

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 841e799dece5..c62570b6eb0f 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -1918,7 +1918,7 @@ static void update_dev_time(const char *device_path)
 		return;
 
 	now = current_time(d_inode(path.dentry));
-	inode_update_time(d_inode(path.dentry), &now, S_MTIME | S_CTIME);
+	inode_update_time(d_inode(path.dentry), &now, S_MTIME | S_CTIME | S_VERSION);
 	path_put(&path);
 }
 
-- 
2.40.1


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

* Re: [PATCH] btrfs: update i_version in update_dev_time
  2023-06-15 12:49 [PATCH] btrfs: update i_version in update_dev_time Jeff Layton
@ 2023-06-19 15:38 ` David Sterba
  0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2023-06-19 15:38 UTC (permalink / raw)
  To: Jeff Layton
  Cc: Chris Mason, Josef Bacik, David Sterba, linux-btrfs, linux-kernel

On Thu, Jun 15, 2023 at 08:49:45AM -0400, Jeff Layton wrote:
> When updating the ctime, we also want to update i_version.
> 
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>  fs/btrfs/volumes.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> This is just something I noticed by inspection. There is probably no way
> to test this today unless you can somehow get to this inode via nfsd.
> Still, I think it's the right thing to do for consistency's sake.

I don't see anything wrong with setting the iversion bit, however I also
don't see where this would be useful. Agreed with the consistency,
otherwise the time is updated when device super block is wiped or a
device initialized, both are big events so missing that due to lack of
iversion update seems unlikely. I'll add it to the queue, thanks.

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

end of thread, other threads:[~2023-06-19 15:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-15 12:49 [PATCH] btrfs: update i_version in update_dev_time Jeff Layton
2023-06-19 15:38 ` David Sterba

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