mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-22 06:32:08 +00:00
pull mnt_want_write()/mnt_drop_write() into kern_path_create()/done_path_create() resp.
One side effect - attempt to create a cross-device link on a read-only fs fails with EROFS instead of EXDEV now. Makes more sense, POSIX allows, etc. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
8e4bfca1d1
commit
a8104a9fcd
3 changed files with 18 additions and 50 deletions
|
@ -876,15 +876,11 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
|
|||
*/
|
||||
mode = S_IFSOCK |
|
||||
(SOCK_INODE(sock)->i_mode & ~current_umask());
|
||||
err = mnt_want_write(path.mnt);
|
||||
if (err)
|
||||
goto out_mknod_dput;
|
||||
err = security_path_mknod(&path, dentry, mode, 0);
|
||||
if (err)
|
||||
goto out_mknod_drop_write;
|
||||
err = vfs_mknod(path.dentry->d_inode, dentry, mode, 0);
|
||||
out_mknod_drop_write:
|
||||
mnt_drop_write(path.mnt);
|
||||
if (err)
|
||||
goto out_mknod_dput;
|
||||
mntget(path.mnt);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue