kill bogus BUG_ON() in do_close_on_exec()
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 12 Nov 2012 06:19:02 +0000 (01:19 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 12 Nov 2012 06:19:02 +0000 (01:19 -0500)
It can be legitimately triggered via procfs access.  Now, at least
2 of 3 of get_files_struct() callers in procfs are useless, but
when and if we get rid of those we can always add WARN_ON() here.
BUG_ON() at that spot is simply wrong.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/file.c

index d3b5fa80b71b76a973919a6b9cfa2ebb34096adf..331e7d24d9d307864a62c5c681be789d396d1410 100644 (file)
--- a/fs/file.c
+++ b/fs/file.c
@@ -685,7 +685,6 @@ void do_close_on_exec(struct files_struct *files)
        struct fdtable *fdt;
 
        /* exec unshares first */
-       BUG_ON(atomic_read(&files->count) != 1);
        spin_lock(&files->file_lock);
        for (i = 0; ; i++) {
                unsigned long set;