diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2016-12-16 11:02:55 +0100 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2016-12-16 11:02:55 +0100 |
commit | ca4c8a3a800039c2681d609c5b7491c1bd17c0a7 (patch) | |
tree | 9175862945696937768703f572078b5043bd0628 /fs/overlayfs/super.c | |
parent | ovl: rename ovl_rename2() to ovl_rename() (diff) | |
download | linux-ca4c8a3a800039c2681d609c5b7491c1bd17c0a7.tar.xz linux-ca4c8a3a800039c2681d609c5b7491c1bd17c0a7.zip |
ovl: treat special files like a regular fs
No sense in opening special files on the underlying layers, they work just
as well if opened on the overlay.
Side effect is that it's no longer possible to connect one side of a pipe
opened on overlayfs with the other side opened on the underlying layer.
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to '')
-rw-r--r-- | fs/overlayfs/super.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index 0e100856c7b8..e296312005cc 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -304,7 +304,7 @@ static struct dentry *ovl_d_real(struct dentry *dentry, { struct dentry *real; - if (d_is_dir(dentry)) { + if (!d_is_reg(dentry)) { if (!inode || inode == d_inode(dentry)) return dentry; goto bug; @@ -575,7 +575,8 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry, if (upperdentry && !d_is_dir(upperdentry)) { inode = ovl_get_inode(dentry->d_sb, realinode); } else { - inode = ovl_new_inode(dentry->d_sb, realinode->i_mode); + inode = ovl_new_inode(dentry->d_sb, realinode->i_mode, + realinode->i_rdev); if (inode) ovl_inode_init(inode, realinode, !!upperdentry); } @@ -1324,7 +1325,7 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent) sb->s_fs_info = ufs; sb->s_flags |= MS_POSIXACL | MS_NOREMOTELOCK; - root_dentry = d_make_root(ovl_new_inode(sb, S_IFDIR)); + root_dentry = d_make_root(ovl_new_inode(sb, S_IFDIR, 0)); if (!root_dentry) goto out_free_oe; |