Skip to contentSkip to conversation

overlay: ovl_get_inode should treat file and dir as same while no upper_mnt

PATCH In review yangerkun 3 participants 4 messages Mar 6, 2018 Overlay filesystem

lore
Share & tools
lore

yangerkun

author
#0 lore raw

PATCH 1/1 overlay: ovl_get_inode should treat file and dir as same while no upper_mnt

When there is no upper_mnt, lower multi hardlink should not construct multi inode for overlay since there won't copyup.

---
 fs/overlayfs/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/overlayfs/inode.c +1 -1
index fcd97b783fa1..fb0a8eff1d8c 100644
@@ -696,7 +696,7 @@ struct inode *ovl_get_inode(struct super_block *sb, struct dentry *upperdentry,
 	 * Hash non-indexed dir by upper inode for NFS export.
 	 */
 	is_dir = S_ISDIR(realinode->i_mode);
-	if (is_dir && (indexed || !sb->s_export_op || !ofs->upper_mnt))
+	if (!ofs->upper_mnt || (is_dir && !sb->s_export_op))
 		origin = lowerdentry;
 
 	if (upperdentry || origin) {
Signature · 1 line
2.13.6
maintainer
#1 lore raw
Quoted 4 lines · yangerkun

When there is no upper_mnt, lower multi hardlink should not construct multi inode for overlay since there won't copyup.

This doesn't really describe a problem.
AFAIK, the only problem has to do with fsnotify and the fix is already in overlayfs-next:
764baba80168 ovl: hash non-dir by lower inode for fsnotify

Miklos,

Are you planning to send a pull request soon?

Thanks,
Amir.

Quoted 21 lines
---
 fs/overlayfs/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/overlayfs/inode.c +1 -2
index fcd97b783fa1..fb0a8eff1d8c 100644
@@ -696,7 +696,7 @@ struct inode *ovl_get_inode(struct super_block *sb, struct dentry *upperdentry,
         * Hash non-indexed dir by upper inode for NFS export.
         */
        is_dir = S_ISDIR(realinode->i_mode);
-       if (is_dir && (indexed || !sb->s_export_op || !ofs->upper_mnt))
+       if (!ofs->upper_mnt || (is_dir && !sb->s_export_op))
                origin = lowerdentry;
 
        if (upperdentry || origin) {
--

2.13.6

maintainer
#2 lore raw
Quoted 6 lines · Amir Goldstein
Quoted 4 lines · yangerkun

When there is no upper_mnt, lower multi hardlink should not construct multi inode for overlay since there won't copyup.

Quoted 8 lines

This doesn't really describe a problem.
AFAIK, the only problem has to do with fsnotify and the fix is already in overlayfs-next:
764baba80168 ovl: hash non-dir by lower inode for fsnotify

Miklos,

Are you planning to send a pull request soon?

OK, I'll submit the pending patches for -rc5.

Do you see any fixes that I missed?

Thanks,
Miklos

maintainer
#3 lore raw
Quoted 12 lines · Miklos Szeredi
Quoted 11 lines · Amir Goldstein
Quoted 4 lines · yangerkun

When there is no upper_mnt, lower multi hardlink should not construct multi inode for overlay since there won't copyup.

This doesn't really describe a problem.
AFAIK, the only problem has to do with fsnotify and the fix is already in overlayfs-next:
764baba80168 ovl: hash non-dir by lower inode for fsnotify

Quoted 8 lines
Quoted 3 lines

Miklos,

Are you planning to send a pull request soon?

OK, I'll submit the pending patches for -rc5.

Do you see any fixes that I missed?

No, I don't.

There's Chengguang syncfs optimization, but that is not a fix, so I reccon, not rc5 material.

Thanks,
Amir.