Skip to content

Commit 8479063

Browse files
Charles Mirabileaxboe
authored andcommitted
io_uring/fs: consider link->flags when getting path for LINKAT
In order for `AT_EMPTY_PATH` to work as expected, the fact that the user wants that behavior needs to make it to `getname_flags` or it will return ENOENT. Fixes: cf30da9 ("io_uring: add support for IORING_OP_LINKAT") Cc: <stable@vger.kernel.org> Link: axboe/liburing#995 Signed-off-by: Charles Mirabile <cmirabil@redhat.com> Link: https://lore.kernel.org/r/20231120105545.1209530-1-cmirabil@redhat.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent a0d45c3 commit 8479063

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

io_uring/fs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ int io_linkat_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
254254
newf = u64_to_user_ptr(READ_ONCE(sqe->addr2));
255255
lnk->flags = READ_ONCE(sqe->hardlink_flags);
256256

257-
lnk->oldpath = getname(oldf);
257+
lnk->oldpath = getname_uflags(oldf, lnk->flags);
258258
if (IS_ERR(lnk->oldpath))
259259
return PTR_ERR(lnk->oldpath);
260260

0 commit comments

Comments
 (0)