Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 96990
b: refs/heads/master
c: adbecb1
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed May 16, 2008
1 parent 4149d3c commit c798a7b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: afbec7fff4928c273a1f1bb14dfdfdf62688a193
refs/heads/master: adbecb128cd2cc5d14b0ebef6d020ced0efd0ec6
10 changes: 8 additions & 2 deletions trunk/fs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,16 @@ struct files_struct *dup_fd(struct files_struct *oldf, int *errorp)

/*
* Check whether we need to allocate a larger fd array and fd set.
* Note: we're not a clone task, so the open count won't change.
*/
if (open_files > new_fdt->max_fds) {
while (unlikely(open_files > new_fdt->max_fds)) {
spin_unlock(&oldf->file_lock);

if (new_fdt != &newf->fdtab) {
free_fdarr(new_fdt);
free_fdset(new_fdt);
kfree(new_fdt);
}

new_fdt = alloc_fdtable(open_files - 1);
if (!new_fdt) {
*errorp = -ENOMEM;
Expand All @@ -335,6 +340,7 @@ struct files_struct *dup_fd(struct files_struct *oldf, int *errorp)
*/
spin_lock(&oldf->file_lock);
old_fdt = files_fdtable(oldf);
open_files = count_open_files(old_fdt);
}

old_fds = old_fdt->fd;
Expand Down

0 comments on commit c798a7b

Please sign in to comment.