autofs: ioctl wrong error handling

Solution In Progress - Updated -

Issue

The following messages can be seen while automount deals with errors on mount triggers, i.e. invalid or yet mounted triggers :

Nov 16 13:06:34 rhel8 automount[38257]: handle_packet_missing_direct: token 44, name /direct_root, request pid 38450
Nov 16 13:06:34 rhel8 automount[38257]: do_mount_direct: direct trigger not valid or already mounted /direct_root
Nov 16 13:06:34 rhel8 automount[38257]: handle_packet_missing_direct: token 45, name /direct_root, request pid 38450
Nov 16 13:06:34 rhel8 automount[38257]: dev_ioctl_send_fail: token = 44
Nov 16 13:06:34 rhel8 automount[38257]: dev_ioctl_send_fail:499: AUTOFS_DEV_IOCTL_FAIL: error Invalid argument
...
Nov 16 13:04:24 rhel8 automount[35232]: do_mount_direct: direct trigger not valid or already mounted /direct_root
Nov 16 13:04:24 rhel8 automount[35232]: dev_ioctl_send_ready: token = 41
Nov 16 13:04:24 rhel8 automount[35232]: dev_ioctl_send_fail: token = 41
Nov 16 13:04:24 rhel8 automount[35232]: dev_ioctl_send_fail:499: AUTOFS_DEV_IOCTL_FAIL: error Bad file descriptor

It may end up causing hang of commands with this stack :

[<0>] autofs_wait+0x320/0x7a0
[<0>] autofs_mount_wait+0x49/0xf0
[<0>] autofs_d_manage+0x85/0x1a0
[<0>] follow_managed+0xaf/0x2f0
[<0>] lookup_fast+0x131/0x2a0
[<0>] walk_component+0x48/0x2f0
[<0>] path_lookupat.isra.49+0x75/0x200
[<0>] filename_lookup.part.65+0xa0/0x170
[<0>] vfs_statx+0x74/0xd0
[<0>] __do_sys_newstat+0x39/0x70
[<0>] do_syscall_64+0x5b/0x1a0
[<0>] entry_SYSCALL_64_after_hwframe+0x65/0xca

Environment

  • Red Hat Enterprise Linux 9
  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 7
  • automount/autofs

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content