We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4368fc6 + 876a3cd commit a8eb8a0Copy full SHA for a8eb8a0
1 file changed
io_uring/register.c
@@ -178,9 +178,17 @@ static __cold int io_register_restrictions(struct io_ring_ctx *ctx,
178
return -EBUSY;
179
180
ret = io_parse_restrictions(arg, nr_args, &ctx->restrictions);
181
- /* Reset all restrictions if an error happened */
+ /*
182
+ * Reset all restrictions if an error happened, but retain any COW'ed
183
+ * settings.
184
+ */
185
if (ret < 0) {
186
+ struct io_bpf_filters *bpf = ctx->restrictions.bpf_filters;
187
+ bool cowed = ctx->restrictions.bpf_filters_cow;
188
+
189
memset(&ctx->restrictions, 0, sizeof(ctx->restrictions));
190
+ ctx->restrictions.bpf_filters = bpf;
191
+ ctx->restrictions.bpf_filters_cow = cowed;
192
return ret;
193
}
194
if (ctx->restrictions.op_registered)
0 commit comments