diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-03-10 23:57:26 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-03-10 23:57:26 +0400 |
commit | e6a4b6f5eaa8478b7a0b9a17e40c51463631db1a (patch) | |
tree | 35e164226b3a590481469a1739a2eb2a7b1217c1 /net | |
parent | 2b64c5434d1303646388e748b7add69624a1cfee (diff) | |
parent | bd2a31d522344b3ac2fb680bd2366e77a9bd8209 (diff) | |
download | linux-e6a4b6f5eaa8478b7a0b9a17e40c51463631db1a.tar.xz |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs fixes from Al Viro.
Clean up file table accesses (get rid of fget_light() in favor of the
fdget() interface), add proper file position locking.
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
get rid of fget_light()
sockfd_lookup_light(): switch to fdget^W^Waway from fget_light
vfs: atomic f_pos accesses as per POSIX
ocfs2 syncs the wrong range...
Diffstat (limited to 'net')
-rw-r--r-- | net/socket.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/net/socket.c b/net/socket.c index 879933aaed4c..fd8d86e06f95 100644 --- a/net/socket.c +++ b/net/socket.c @@ -450,16 +450,17 @@ EXPORT_SYMBOL(sockfd_lookup); static struct socket *sockfd_lookup_light(int fd, int *err, int *fput_needed) { - struct file *file; + struct fd f = fdget(fd); struct socket *sock; *err = -EBADF; - file = fget_light(fd, fput_needed); - if (file) { - sock = sock_from_file(file, err); - if (sock) + if (f.file) { + sock = sock_from_file(f.file, err); + if (likely(sock)) { + *fput_needed = f.flags; return sock; - fput_light(file, *fput_needed); + } + fdput(f); } return NULL; } |