aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/fdtable.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h
index a2ec74bc4812..144412ffaced 100644
--- a/include/linux/fdtable.h
+++ b/include/linux/fdtable.h
@@ -57,7 +57,11 @@ struct files_struct {
57 struct file * fd_array[NR_OPEN_DEFAULT]; 57 struct file * fd_array[NR_OPEN_DEFAULT];
58}; 58};
59 59
60#define files_fdtable(files) (rcu_dereference((files)->fdt)) 60#define files_fdtable(files) \
61 (rcu_dereference_check((files)->fdt, \
62 rcu_read_lock_held() || \
63 lockdep_is_held(&(files)->file_lock) || \
64 atomic_read(&files->count) == 1))
61 65
62struct file_operations; 66struct file_operations;
63struct vfsmount; 67struct vfsmount;
@@ -78,7 +82,7 @@ static inline struct file * fcheck_files(struct files_struct *files, unsigned in
78 struct fdtable *fdt = files_fdtable(files); 82 struct fdtable *fdt = files_fdtable(files);
79 83
80 if (fd < fdt->max_fds) 84 if (fd < fdt->max_fds)
81 file = rcu_dereference(fdt->fd[fd]); 85 file = rcu_dereference_check(fdt->fd[fd], rcu_read_lock_held() || lockdep_is_held(&files->file_lock) || atomic_read(&files->count) == 1);
82 return file; 86 return file;
83} 87}
84 88