On 2/6/20 10:05 AM, Stefan Metzmacher wrote: >>> While researching that I noticed that IOSQE_FIXED_FILE >>> seems to be ignored for some new commands, I think that >>> all commands with on input fd, should be able to use that flag. >>> Can this be fixed before 5.6 final? >> >> Do you have specifics? Generally the file grabbing happens as part of >> request prep, and the individual opcodes should not need to bother with >> it. > > io_statx_prep(): > io_openat_prep(): > io_openat2_prep(): > > req->open.dfd = READ_ONCE(sqe->fd); > > > io_statx(): > ret = filename_lookup(ctx->dfd, ctx->filename, lookup_flags... > > io_openat2(): > > file = do_filp_open(req->open.dfd, req->open.filename, &op); > > io_close_prep(): has this to make it clear that IOSQE_FIXED_FILE is not > supported, I guess because FILE_UPDATE with -1 needs to be used instead? > > if (sqe->flags & IOSQE_FIXED_FILE) > return -EINVAL; > > req->close.fd = READ_ONCE(sqe->fd); > > > I guess at least we need if (sqe->flags & IOSQE_FIXED_FILE) in all > cases, if we can't just fix it. Ah yes good point, on both honoring it and failing it for close() when we do honor it. I'll fix that up. -- Jens Axboe