]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/blobdiff - fs/select.c
btrfs: fix metadata extent leak after failure to create subvolume
[mirror_ubuntu-focal-kernel.git] / fs / select.c
index 53a0c149f528391a51b9644e3bf99a5cc4b4f3cd..e51796063cb6eacf6256688fb9a8a6650e5cf140 100644 (file)
@@ -1037,10 +1037,9 @@ static long do_restart_poll(struct restart_block *restart_block)
 
        ret = do_sys_poll(ufds, nfds, to);
 
-       if (ret == -ERESTARTNOHAND) {
-               restart_block->fn = do_restart_poll;
-               ret = -ERESTART_RESTARTBLOCK;
-       }
+       if (ret == -ERESTARTNOHAND)
+               ret = set_restart_fn(restart_block, do_restart_poll);
+
        return ret;
 }
 
@@ -1062,7 +1061,6 @@ SYSCALL_DEFINE3(poll, struct pollfd __user *, ufds, unsigned int, nfds,
                struct restart_block *restart_block;
 
                restart_block = &current->restart_block;
-               restart_block->fn = do_restart_poll;
                restart_block->poll.ufds = ufds;
                restart_block->poll.nfds = nfds;
 
@@ -1073,7 +1071,7 @@ SYSCALL_DEFINE3(poll, struct pollfd __user *, ufds, unsigned int, nfds,
                } else
                        restart_block->poll.has_timeout = 0;
 
-               ret = -ERESTART_RESTARTBLOCK;
+               ret = set_restart_fn(restart_block, do_restart_poll);
        }
        return ret;
 }