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: <[email protected]> Link: axboe/liburing#995 Signed-off-by: Charles Mirabile <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent a0d45c3 commit 8479063

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)