Commit beef5121 authored by Miklos Szeredi's avatar Miklos Szeredi

Revert "af_unix: fix hard linked sockets on overlay"

This reverts commit eb0a4a47.

Since commit 51f7e52d ("ovl: share inode for hard link") there's no
need to call d_real_inode() to check two overlay inodes for equality.

Side effect of this revert is that it's no longer possible to connect one
socket on overlayfs to one on the underlying layer (something which didn't
make sense anyway).
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent 3e5de27e
...@@ -315,7 +315,7 @@ static struct sock *unix_find_socket_byinode(struct inode *i) ...@@ -315,7 +315,7 @@ static struct sock *unix_find_socket_byinode(struct inode *i)
&unix_socket_table[i->i_ino & (UNIX_HASH_SIZE - 1)]) { &unix_socket_table[i->i_ino & (UNIX_HASH_SIZE - 1)]) {
struct dentry *dentry = unix_sk(s)->path.dentry; struct dentry *dentry = unix_sk(s)->path.dentry;
if (dentry && d_real_inode(dentry) == i) { if (dentry && d_backing_inode(dentry) == i) {
sock_hold(s); sock_hold(s);
goto found; goto found;
} }
...@@ -913,7 +913,7 @@ static struct sock *unix_find_other(struct net *net, ...@@ -913,7 +913,7 @@ static struct sock *unix_find_other(struct net *net,
err = kern_path(sunname->sun_path, LOOKUP_FOLLOW, &path); err = kern_path(sunname->sun_path, LOOKUP_FOLLOW, &path);
if (err) if (err)
goto fail; goto fail;
inode = d_real_inode(path.dentry); inode = d_backing_inode(path.dentry);
err = inode_permission(inode, MAY_WRITE); err = inode_permission(inode, MAY_WRITE);
if (err) if (err)
goto put_fail; goto put_fail;
...@@ -1040,7 +1040,7 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) ...@@ -1040,7 +1040,7 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
goto out_up; goto out_up;
} }
addr->hash = UNIX_HASH_SIZE; addr->hash = UNIX_HASH_SIZE;
hash = d_real_inode(path.dentry)->i_ino & (UNIX_HASH_SIZE - 1); hash = d_backing_inode(path.dentry)->i_ino & (UNIX_HASH_SIZE - 1);
spin_lock(&unix_table_lock); spin_lock(&unix_table_lock);
u->path = path; u->path = path;
list = &unix_socket_table[hash]; list = &unix_socket_table[hash];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment