Skip to contentSkip to conversation

ecryptfs: remove unnecessary i_version bump

PATCH In review Jeff Layton 3 participants 3 messages Oct 30, 2017 – Nov 2, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ecryptfs: remove unnecessary i_version bump

From: Jeff Layton <[email protected]>

There is no need to bump the i_version counter here, as ecryptfs does not set the MS_I_VERSION flag, and doesn't use it internally. It also only bumps it when the inode is instantiated, which doesn't make much sense.

---
 fs/ecryptfs/inode.c | 1 -
 1 file changed, 1 deletion(-)
fs/ecryptfs/inode.c +0 -1
index efc2db42d175..b59b083379ea 100644
@@ -64,7 +64,6 @@ static int ecryptfs_inode_set(struct inode *inode, void *opaque)
 	/* i_size will be overwritten for encrypted regular files */
 	fsstack_copy_inode_size(inode, lower_inode);
 	inode->i_ino = lower_inode->i_ino;
-	inode->i_version++;
 	inode->i_mapping->a_ops = &ecryptfs_aops;
 
 	if (S_ISLNK(inode->i_mode))
Signature · 1 line
2.13.6
#1 lore raw
Quoted 4 lines · Jeff Layton

From: Jeff Layton <[email protected]>

There is no need to bump the i_version counter here, as ecryptfs does not set the MS_I_VERSION flag, and doesn't use it internally. It also

My apologies, I've been sitting on this patch for a while now. That should be changed to the SB_I_VERSION flag. Tyler, do you mind fixing that up before merge, or would you like me to resend?

Quoted 20 lines

only bumps it when the inode is instantiated, which doesn't make much sense.

---
 fs/ecryptfs/inode.c | 1 -
 1 file changed, 1 deletion(-)
fs/ecryptfs/inode.c +0 -1
index efc2db42d175..b59b083379ea 100644
@@ -64,7 +64,6 @@ static int ecryptfs_inode_set(struct inode *inode, void *opaque)
 	/* i_size will be overwritten for encrypted regular files */
 	fsstack_copy_inode_size(inode, lower_inode);
 	inode->i_ino = lower_inode->i_ino;
-	inode->i_version++;
 	inode->i_mapping->a_ops = &ecryptfs_aops;
 
 	if (S_ISLNK(inode->i_mode))
Signature · 1 line
Jeff Layton <[email protected]>
#2 lore raw
Quoted 9 lines · Jeff Layton
Quoted 4 lines · Jeff Layton

From: Jeff Layton <[email protected]>

There is no need to bump the i_version counter here, as ecryptfs does not set the MS_I_VERSION flag, and doesn't use it internally. It also

My apologies, I've been sitting on this patch for a while now. That should be changed to the SB_I_VERSION flag. Tyler, do you mind fixing that up before merge, or would you like me to resend?

That's no problem. Thanks for the patch! It looks good to me and I'll take it through my tree.

Tyler

Quoted 22 lines
Quoted 21 lines

only bumps it when the inode is instantiated, which doesn't make much sense.

---
 fs/ecryptfs/inode.c | 1 -
 1 file changed, 1 deletion(-)
fs/ecryptfs/inode.c +0 -1
index efc2db42d175..b59b083379ea 100644
@@ -64,7 +64,6 @@ static int ecryptfs_inode_set(struct inode *inode, void *opaque)
 	/* i_size will be overwritten for encrypted regular files */
 	fsstack_copy_inode_size(inode, lower_inode);
 	inode->i_ino = lower_inode->i_ino;
-	inode->i_version++;
 	inode->i_mapping->a_ops = &ecryptfs_aops;
 
 	if (S_ISLNK(inode->i_mode))