Signed-off-by: Dave Hansen <[EMAIL PROTECTED]>
---
lxc-dave/net/unix/af_unix.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff -puN
net/unix/af_unix.c~12-24-unix-find-other-elevate-write-count-for-touch-atime
net/unix/af_unix.c
---
lxc/net/unix/af_unix.c~12-24-unix-find-other-elevate-write-count-for-touch-atime
2007-02-09 14:26:52.000000000 -0800
+++ lxc-dave/net/unix/af_unix.c 2007-02-09 14:26:52.000000000 -0800
@@ -703,21 +703,27 @@ static struct sock *unix_find_other(stru
err = path_lookup(sunname->sun_path, LOOKUP_FOLLOW, &nd);
if (err)
goto fail;
+
+ err = mnt_want_write(nd.mnt);
+ if (err)
+ goto put_path_fail;
+
err = vfs_permission(&nd, MAY_WRITE);
if (err)
- goto put_fail;
+ goto mnt_drop_write_fail;
err = -ECONNREFUSED;
if (!S_ISSOCK(nd.dentry->d_inode->i_mode))
- goto put_fail;
+ goto mnt_drop_write_fail;
u=unix_find_socket_byinode(nd.dentry->d_inode);
if (!u)
- goto put_fail;
+ goto mnt_drop_write_fail;
if (u->sk_type == type)
touch_atime(nd.mnt, nd.dentry);
path_release(&nd);
+ mnt_drop_write(nd.mnt);
err=-EPROTOTYPE;
if (u->sk_type != type) {
@@ -737,7 +743,9 @@ static struct sock *unix_find_other(stru
}
return u;
-put_fail:
+mnt_drop_write_fail:
+ mnt_drop_write(nd.mnt);
+put_path_fail:
path_release(&nd);
fail:
*error=err;
_
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- [PATCH 01/22] filesystem helpers for custom 'struct fil... Dave Hansen
- [PATCH 03/22] record when sb_writer_count elevated... Dave Hansen
- [PATCH 21/22] honor r/w changes at do_remount() ti... Dave Hansen
- Re: [PATCH 21/22] honor r/w changes at do_remo... Andrew Morton
- Re: [PATCH 21/22] honor r/w changes at do_... Dave Hansen
- Re: [PATCH 21/22] honor r/w changes at do_... Anton Altaparmakov
- Re: [PATCH 21/22] honor r/w changes at do_... Jan Engelhardt
- [PATCH 05/22] elevate mnt writers for callers of v... Dave Hansen
- [PATCH 09/22] mount_is_safe(): add comment Dave Hansen
- [PATCH 10/22] unix_find_other() elevate write coun... Dave Hansen
- [PATCH 11/22] elevate write count over calls to vf... Dave Hansen
- [PATCH 18/22] do_rmdir(): elevate write count Dave Hansen
- [PATCH 20/22] [PATCH] gfs: check nlink count Dave Hansen
- [PATCH 17/22] elevate mnt writers for vfs_unlink()... Dave Hansen
- [PATCH 14/22] elevate write count for do_utimes() Dave Hansen
- [PATCH 16/22] sys_mknodat(): elevate write count f... Dave Hansen
- [PATCH 13/22] elevate writer count for do_sys_trun... Dave Hansen
- [PATCH 15/22] elevate write count for do_sys_utime... Dave Hansen
- [PATCH 12/22] elevate write count files are open()... Dave Hansen
- Re: [PATCH 12/22] elevate write count files ar... Andrew Morton

