Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Jun 2023 13:58:47 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 272127] fdescfs with linkrdlnk fails openat with O_DIRECTORY unless "ls -l" done in fdescfs dir first...
Message-ID:  <bug-272127-227-k995Rqtyre@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-272127-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-272127-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D272127

--- Comment #2 from Peter Eriksson <pen@lysator.liu.se> ---
It's not just related to O_DIRECTORY but a more general problem with fdescf=
s...

root@runur00:/export/build/samba # umount /compat/linux/dev/fd
root@runur00:/export/build/samba # mount /compat/linux/dev/fd

root@runur00:/export/build/samba # ./t -d /home/peter86 RUNUR00
open("/home/peter86", O_PATH) -> 3
  facl(3, ACE_GETACLCNT) -> -1 [errno=3D9 (Bad file descriptor)]
  openat(3, "RUNUR00", O_RDONLY) -> 4
    facl(4, ACE_GETACLCNT) -> 3
    acl("/compat/linux/dev/fd/4", ACE_GETACLCNT) -> -1 [errno=3D78 (Functio=
n not
implemented)]
  openat(3, "RUNUR00", O_PATH) -> 4
    facl(4, ACE_GETACLCNT) -> -1 [errno=3D9 (Bad file descriptor)]
    acl("/compat/linux/dev/fd/4", ACE_GETACLCNT) -> -1 [errno=3D78 (Functio=
n not
implemented)]
    openat(4, "", O_EMPTY_PATH) -> 5
      facl(5, ACE_GETACLCNT) -> 3
    open("/compat/linux/dev/fd/4", O_RDONLY) -> -1 [errno=3D20 (Not a direc=
tory)]

root@runur00:/export/build/samba # ls -ld /home/peter86/RUNUR00
drwx------+ 2 peter86  employee-liu.se  2 Jun 20 10:52 /home/peter86/RUNUR00

root@runur00:/export/build/samba # ./t -ssd /home/peter86 RUNUR00
open("/home/peter86", O_PATH) -> 3
  facl(3, ACE_GETACLCNT) -> -1 [errno=3D9 (Bad file descriptor)]
  openat(3, "RUNUR00", O_RDONLY) -> 4
    facl(4, ACE_GETACLCNT) -> 3
    stat("/compat/linux/dev/fd/4") -> 0 [type=3Dsymlink, size=3D0, uid=3D0,=
 gid=3D0]
    readlink("/compat/linux/dev/fd/4") -> 28
[path=3D/export/home/peter86/RUNUR00]
    stat("/compat/linux/dev/fd/4") -> 0 [type=3Ddir, size=3D2, uid=3D100325=
8,
gid=3D100001000]
    acl("/compat/linux/dev/fd/4", ACE_GETACLCNT) -> 3
  openat(3, "RUNUR00", O_PATH) -> 4
    facl(4, ACE_GETACLCNT) -> -1 [errno=3D9 (Bad file descriptor)]
    stat("/compat/linux/dev/fd/4") -> 0 [type=3Ddir, size=3D2, uid=3D100325=
8,
gid=3D100001000]
    stat("/compat/linux/dev/fd/4") -> 0 [type=3Ddir, size=3D2, uid=3D100325=
8,
gid=3D100001000]
    acl("/compat/linux/dev/fd/4", ACE_GETACLCNT) -> 3
    openat(4, "", O_EMPTY_PATH) -> 5
      facl(5, ACE_GETACLCNT) -> 3
    open("/compat/linux/dev/fd/4", O_RDONLY) -> 5
      facl(5, ACE_GETACLCNT) -> 3

root@runur00:/export/build/samba # ./t -d /home/peter86 RUNUR00
open("/home/peter86", O_PATH) -> 3
  facl(3, ACE_GETACLCNT) -> -1 [errno=3D9 (Bad file descriptor)]
  openat(3, "RUNUR00", O_RDONLY) -> 4
    facl(4, ACE_GETACLCNT) -> 3
    acl("/compat/linux/dev/fd/4", ACE_GETACLCNT) -> 3
  openat(3, "RUNUR00", O_PATH) -> 4
    facl(4, ACE_GETACLCNT) -> -1 [errno=3D9 (Bad file descriptor)]
    acl("/compat/linux/dev/fd/4", ACE_GETACLCNT) -> 3
    openat(4, "", O_EMPTY_PATH) -> 5
      facl(5, ACE_GETACLCNT) -> 3
    open("/compat/linux/dev/fd/4", O_RDONLY) -> 5
      facl(5, ACE_GETACLCNT) -> 3


See how the first stat() call to a fd in the fdescfs also gives invalid siz=
e,
uid & gid data but as soon as that stat call has pulled in the information
about the target things work fine.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-272127-227-k995Rqtyre>