projects
/
deliverable
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ARM: migrate to common PSCI client code
[deliverable/linux.git]
/
fs
/
file.c
diff --git
a/fs/file.c
b/fs/file.c
index 3d2eb4c542a491e686d9455e190d3e8760cedaee..6c672ad329e9a8c6bf3b7925f9e344ea1c5991c4 100644
(file)
--- a/
fs/file.c
+++ b/
fs/file.c
@@
-664,11
+664,17
@@
static struct file *__fget(unsigned int fd, fmode_t mask)
struct file *file;
rcu_read_lock();
struct file *file;
rcu_read_lock();
+loop:
file = fcheck_files(files, fd);
if (file) {
file = fcheck_files(files, fd);
if (file) {
- /* File object ref couldn't be taken */
- if ((file->f_mode & mask) || !get_file_rcu(file))
+ /* File object ref couldn't be taken.
+ * dup2() atomicity guarantee is the reason
+ * we loop to catch the new file (or NULL pointer)
+ */
+ if (file->f_mode & mask)
file = NULL;
file = NULL;
+ else if (!get_file_rcu(file))
+ goto loop;
}
rcu_read_unlock();
}
rcu_read_unlock();
This page took
0.029021 seconds
and
5
git commands to generate.