Skip to content

Commit c336e99

Browse files
committed
io_uring: remove bogus RLIMIT_NOFILE check in file registration
We already checked this limit when the file was opened, and we keep it open in the file table. Hence when we added unit_inflight to the count we want to register, we're doubly accounting these files. This results in -EMFILE for file registration, if we're at half the limit. Cc: [email protected] # v5.1+ Signed-off-by: Jens Axboe <[email protected]>
1 parent aa96bf8 commit c336e99

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

fs/io_uring.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6216,13 +6216,6 @@ static int __io_sqe_files_scm(struct io_ring_ctx *ctx, int nr, int offset)
62166216
struct sk_buff *skb;
62176217
int i, nr_files;
62186218

6219-
if (!capable(CAP_SYS_RESOURCE) && !capable(CAP_SYS_ADMIN)) {
6220-
unsigned long inflight = ctx->user->unix_inflight + nr;
6221-
6222-
if (inflight > task_rlimit(current, RLIMIT_NOFILE))
6223-
return -EMFILE;
6224-
}
6225-
62266219
fpl = kzalloc(sizeof(*fpl), GFP_KERNEL);
62276220
if (!fpl)
62286221
return -ENOMEM;

0 commit comments

Comments
 (0)