git: 86bcdd9d3463 - stable/13 - linux_name_to_handle_at: Support AT_EMPTY_PATH.

From: Dmitry Chagin <dchagin_at_FreeBSD.org>
Date: Fri, 17 Jun 2022 19:38:28 UTC
The branch stable/13 has been updated by dchagin:

URL: https://cgit.FreeBSD.org/src/commit/?id=86bcdd9d34638cabab1852d0ae1df6059c4f673d

commit 86bcdd9d34638cabab1852d0ae1df6059c4f673d
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2021-11-17 23:51:18 +0000
Commit:     Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2022-06-17 19:33:39 +0000

    linux_name_to_handle_at: Support AT_EMPTY_PATH.
    
    Reviewed by:    kib
    Sponsored by:   The University of Cambridge, Google Inc.
    Differential Revision:  https://reviews.freebsd.org/D33050
    
    (cherry picked from commit 8b2ce7a3bbd0a754d31ff3943d918b4c84c831a3)
---
 sys/compat/linux/linux_file.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c
index a076c849aec8..bda843286b26 100644
--- a/sys/compat/linux/linux_file.c
+++ b/sys/compat/linux/linux_file.c
@@ -282,9 +282,6 @@ linux_name_to_handle_at(struct thread *td,
 
 	if (args->flags & ~valid_flags)
 		return (EINVAL);
-	if (args->flags & LINUX_AT_EMPTY_PATH)
-		/* XXX: not supported yet */
-		return (EOPNOTSUPP);
 
 	fd = args->dirfd;
 	if (fd == LINUX_AT_FDCWD)
@@ -293,6 +290,8 @@ linux_name_to_handle_at(struct thread *td,
 	bsd_flags = 0;
 	if (!(args->flags & LINUX_AT_SYMLINK_FOLLOW))
 		bsd_flags |= AT_SYMLINK_NOFOLLOW;
+	if ((args->flags & LINUX_AT_EMPTY_PATH) != 0)
+		bsd_flags |= AT_EMPTY_PATH;
 
 	if (!LUSECONVPATH(td)) {
 		error = kern_getfhat(td, bsd_flags, fd, args->name,