io_uring/fs: consider link->flags when getting path for LINKAT
Subsystems (2)
PATCH 1/1 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.
--- io_uring/fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
io_uring/fs.c +1 -1
@@ -254,7 +254,7 @@ int io_linkat_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) newf =u64_to_user_ptr (READ_ONCE (sqe->addr2)); lnk->flags =READ_ONCE (sqe->hardlink_flags); - lnk->oldpath =getname (oldf); + lnk->oldpath =getname_uflags (oldf, lnk->flags);if (IS_ERR (lnk->oldpath))return PTR_ERR (lnk->oldpath);
Signature · 1 line
2.41.0
Jens Axboe
maintainerQuoted 3 lines · Charles Mirabile
In order for
AT_EMPTY_PATHto work as expected, the fact that the user wants that behavior needs to make it togetname_flagsor it will return ENOENT.
Looks good - do you have a liburing test case for this too?
Signature · 1 line
Jens Axboe
Quoted 7 lines · Jens Axboe
Quoted 3 lines · Charles Mirabile
In order for
AT_EMPTY_PATHto work as expected, the fact that the user wants that behavior needs to make it togetname_flagsor it will return ENOENT.Looks good - do you have a liburing test case for this too?
Yes, see here https://github.com/axboe/liburing/issues/995 and here
https://github.com/axboe/liburing/pull/996.
Quoted 4 lines
--
Jens Axboe
Best - Charlie
Jens Axboe
maintainerQuoted 10 lines · Charles Mirabile
Quoted 7 lines · Jens Axboe
Quoted 3 lines · Charles Mirabile
In order for
AT_EMPTY_PATHto work as expected, the fact that the user wants that behavior needs to make it togetname_flagsor it will return ENOENT.Looks good - do you have a liburing test case for this too?
Yes, see here https://github.com/axboe/liburing/issues/995 and here
https://github.com/axboe/liburing/pull/996.
Ah thank you - for some reason github stopped notifying me...
Signature · 1 line
Jens Axboe
Quoted 5 lines · Charles Mirabile
In order for
AT_EMPTY_PATHto work as expected, the fact that the user wants that behavior needs to make it togetname_flagsor it will return ENOENT.
Applied, thanks!
[1/1] io_uring/fs: consider link->flags when getting path for LINKAT
(no commit info)
Best regards,
Signature · 1 line
Jens Axboe