From: "Darrick J. Wong" <djwong@kernel.org>
To: Theodore Ts'o <tytso@mit.edu>
Cc: linux-ext4 <linux-ext4@vger.kernel.org>
Subject: [PATCH 1/2] libext2fs: use F_GETFL, not F_GETFD, in unixfd_open
Date: Thu, 28 Aug 2025 07:43:12 -0700 [thread overview]
Message-ID: <20250828144312.GA8084@frogsfrogsfrogs> (raw)
From: Darrick J. Wong <djwong@kernel.org>
F_GETFD is the fcntl command that returns FD_* flags, but the callsite
wants to look at the O_* flags. F_GETFL is the fcntl command that
returns the O_* flags, so change the subcommand to be correct.
Cc: <linux-ext4@vger.kernel.org> # v1.43.2
Fixes: 4ccf9e4fe165cf ("libext2fs: add unixfd_io_manager")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
lib/ext2fs/unix_io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c
index 4a841f7f2133d4..e839628aa1b74d 100644
--- a/lib/ext2fs/unix_io.c
+++ b/lib/ext2fs/unix_io.c
@@ -1168,7 +1168,7 @@ static errcode_t unixfd_open(const char *str_fd, int flags,
fd = atoi(str_fd);
#if defined(HAVE_FCNTL)
- fd_flags = fcntl(fd, F_GETFD);
+ fd_flags = fcntl(fd, F_GETFL);
if (fd_flags == -1)
return EBADF;
next reply other threads:[~2025-08-28 14:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-28 14:43 Darrick J. Wong [this message]
2025-08-28 14:46 ` [PATCH 2/2] libext2fs: don't look for O_EXCL in the F_GETFL output Darrick J. Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250828144312.GA8084@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).