Skip to content

Commit 735c907

Browse files
amir73ilMiklos Szeredi
authored andcommitted
ovl: fix out of date comment and unreachable code
ovl_inode_update() is no longer called from create object code path. Fixes: 01b39dc ("ovl: use inode_insert5() to hash a newly...") Signed-off-by: Amir Goldstein <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
1 parent 300b124 commit 735c907

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

fs/overlayfs/inode.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -571,9 +571,11 @@ static void ovl_fill_inode(struct inode *inode, umode_t mode, dev_t rdev,
571571
* bits to encode layer), set the same value used for st_ino to i_ino,
572572
* so inode number exposed via /proc/locks and a like will be
573573
* consistent with d_ino and st_ino values. An i_ino value inconsistent
574-
* with d_ino also causes nfsd readdirplus to fail. When called from
575-
* ovl_new_inode(), ino arg is 0, so i_ino will be updated to real
576-
* upper inode i_ino on ovl_inode_init() or ovl_inode_update().
574+
* with d_ino also causes nfsd readdirplus to fail.
575+
*
576+
* When called from ovl_create_object() => ovl_new_inode(), with
577+
* ino = 0, i_ino will be updated to consistent value later on in
578+
* ovl_get_inode() => ovl_fill_inode().
577579
*/
578580
if (ovl_same_dev(inode->i_sb)) {
579581
inode->i_ino = ino;

fs/overlayfs/util.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,6 @@ void ovl_inode_update(struct inode *inode, struct dentry *upperdentry)
416416
smp_wmb();
417417
OVL_I(inode)->__upperdentry = upperdentry;
418418
if (inode_unhashed(inode)) {
419-
if (!inode->i_ino)
420-
inode->i_ino = upperinode->i_ino;
421419
inode->i_private = upperinode;
422420
__insert_inode_hash(inode, (unsigned long) upperinode);
423421
}

0 commit comments

Comments
 (0)