Linux userland API discussions
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx@kernel.org>
To: Andrey Albershteyn <aalbersh@kernel.org>
Cc: linux-man@vger.kernel.org, linux-api@vger.kernel.org,
	 linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Christoph Hellwig <hch@lst.de>,
	 djwong@kernel.org
Subject: Re: [PATCH v5 2/3] man/man2: introduce man page for file_getattr(2) syscall
Date: Wed, 21 Oct 2026 19:49:29 +0200	[thread overview]
Message-ID: <atj5s3WAmsjv9aq9@debian> (raw)
In-Reply-To: <as9EIPE2lLJs9ram@aalbersh-thinkpadx1carbongen13.rmtcz.csb>

[-- Attachment #1: Type: text/plain, Size: 2318 bytes --]

Hi Andrey,

> Date: 2026-10-14 11:14:07+0200
> From: Andrey Albershteyn <aalbersh@kernel.org>
>
> On 2026-10-11 19:06:32, Alejandro Colomar wrote:
> > Hi Andrey,
> > 
> > > +As with
> > > +.BR openat (2),
> > > +if
> > > +.I path
> > > +is relative,
> > > +then it is interpreted relative to the directory
> > > +referred to by the file descriptor
> > > +.IR dirfd .
> > > +The special
> > > +.I dirfd
> > > +value
> > > +.B AT_FDCWD
> > > +can be used to refer to the current working directory of the calling process.
> > > +If
> > > +.I path
> > > +is absolute,
> > > +then
> > > +.I dirfd
> > > +is ignored.
> > 
> > Is there any difference with openat(2) regarding the handling of 'path'
> > and 'dirfd'?  If not, we could say:
> > 
> > 	The
> > 	.I dirfd
> > 	and
> > 	.I path
> > 	arguments behave in the same way as in
> > 	.BR openat (2).
> > 
> > Is there any small difference, or is it exactly as in openat(2)?
> 
> The difference I found is that
> file_getattr(fd, NULL, ..., AT_EMPTY_PATH) succeeds but the
> openat(fd, NULL, O_EMPTYPATH) returns -EFAULT. openat() always wants
> an empty string while file_attr() can work with NULL.
> 
> 	The
> 	.I dirfd
> 	and
> 	.I path
> 	arguments behave in the same way as in
> 	.BR openat (2),
> 	with the divergence that
> 	.I path
> 	can be NULL meaning an empty string.
> 
> so maybe like this?

Sorry that I missed this email.  I had an attack from a nation-state,
and had to be very careful with my hardware and communications.  I will
probably say something more detailed on the mailing list, but I'll only
share some details encrypted with very few people to not give too much
information that might help them.  Anyway, when I got back to normal, I
missed this and some other emails.

And yes, this text seems good to me.  I see your new revision, so I'll
review that.  BTW, I wonder why there's this difference between
openat(2); was it on purpose?  Should we maybe require that callers use
an empty string with file_getattr(2) too?  Or perhaps allow NULL in
openat(2)?  (I prefer the former.)

In any case, I'll take your wording, since it documents reality.  I just
wonder whether reality should be changed.


Have a lovely night!
Alex

-- 
<https://www.alejandro-colomar.es>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2026-10-21 17:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14 11:11 [PATCH v3] man/man2: introduce man page for file_getattr/file_setattr syscalls Andrey Albershteyn
2026-09-14 12:43 ` Alejandro Colomar
2026-09-14 13:52   ` Andrey Albershteyn
2026-09-16 11:51 ` [PATCH v4] " Andrey Albershteyn
2026-09-21  3:51   ` Darrick J. Wong
2026-10-11 17:07     ` Alejandro Colomar
2026-09-26 13:58   ` Alejandro Colomar
2026-09-29 13:02   ` [PATCH v5 0/3] Introduce man pages for file_getattr() and file_setattr() Andrey Albershteyn
2026-09-29 13:02   ` [PATCH v5 1/3] man/man2: introduce man page for struct file_attr Andrey Albershteyn
2026-10-11 16:58     ` Alejandro Colomar
2026-09-29 13:02   ` [PATCH v5 2/3] man/man2: introduce man page for file_getattr(2) syscall Andrey Albershteyn
2026-10-11 17:06     ` Alejandro Colomar
2026-10-14  9:14       ` Andrey Albershteyn
2026-10-21 17:49         ` Alejandro Colomar [this message]
2026-10-22  8:43           ` Andrey Albershteyn
2026-10-22  9:27             ` Alejandro Colomar
2026-10-22 11:01               ` Andrey Albershteyn
2026-09-29 13:02   ` [PATCH v5 3/3] man/man2: introduce man page for file_setattr(2) syscall Andrey Albershteyn

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=atj5s3WAmsjv9aq9@debian \
    --to=alx@kernel.org \
    --cc=aalbersh@kernel.org \
    --cc=djwong@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /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