]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/file.c
blk-mq: don't lose requests if a stopped queue restarts
[mirror_ubuntu-bionic-kernel.git] / fs / file.c
index ab3eb6a8823940643ab376782cd9a1e47c583c98..93c5f89c248b07b6fba50fd31f4bd36ba9520fef 100644 (file)
--- a/fs/file.c
+++ b/fs/file.c
@@ -638,8 +638,7 @@ static struct file *__fget(unsigned int fd, fmode_t mask)
        file = fcheck_files(files, fd);
        if (file) {
                /* File object ref couldn't be taken */
-               if ((file->f_mode & mask) ||
-                   !atomic_long_inc_not_zero(&file->f_count))
+               if ((file->f_mode & mask) || !get_file_rcu(file))
                        file = NULL;
        }
        rcu_read_unlock();
@@ -869,7 +868,7 @@ SYSCALL_DEFINE1(dup, unsigned int, fildes)
        struct file *file = fget_raw(fildes);
 
        if (file) {
-               ret = get_unused_fd();
+               ret = get_unused_fd_flags(0);
                if (ret >= 0)
                        fd_install(ret, file);
                else