diff options
Diffstat (limited to 'fs/exec.c')
| -rw-r--r-- | fs/exec.c | 8 |
1 files changed, 5 insertions, 3 deletions
| @@ -798,6 +798,7 @@ no_thread_group: | |||
| 798 | static inline void flush_old_files(struct files_struct * files) | 798 | static inline void flush_old_files(struct files_struct * files) |
| 799 | { | 799 | { |
| 800 | long j = -1; | 800 | long j = -1; |
| 801 | struct fdtable *fdt; | ||
| 801 | 802 | ||
| 802 | spin_lock(&files->file_lock); | 803 | spin_lock(&files->file_lock); |
| 803 | for (;;) { | 804 | for (;;) { |
| @@ -805,12 +806,13 @@ static inline void flush_old_files(struct files_struct * files) | |||
| 805 | 806 | ||
| 806 | j++; | 807 | j++; |
| 807 | i = j * __NFDBITS; | 808 | i = j * __NFDBITS; |
| 808 | if (i >= files->max_fds || i >= files->max_fdset) | 809 | fdt = files_fdtable(files); |
| 810 | if (i >= fdt->max_fds || i >= fdt->max_fdset) | ||
| 809 | break; | 811 | break; |
| 810 | set = files->close_on_exec->fds_bits[j]; | 812 | set = fdt->close_on_exec->fds_bits[j]; |
| 811 | if (!set) | 813 | if (!set) |
| 812 | continue; | 814 | continue; |
| 813 | files->close_on_exec->fds_bits[j] = 0; | 815 | fdt->close_on_exec->fds_bits[j] = 0; |
| 814 | spin_unlock(&files->file_lock); | 816 | spin_unlock(&files->file_lock); |
| 815 | for ( ; set ; i++,set >>= 1) { | 817 | for ( ; set ; i++,set >>= 1) { |
| 816 | if (set & 1) { | 818 | if (set & 1) { |
