We are seeing systemd hang on its autofs direct mount at
/proc/sys/fs/binfmt_misc.
Historically this was due to a mismatch in the communication structure
size between a 64 bit kernel and a 32 bit user space and was fixed by
making the pipe communication record oriented.
During autofs v5 development I decided to stay with the existing usage
instead of changing to a packed structure for autofs <=> user space
communications which turned out to be a mistake on my part.
Problems arose and they were fixed by allowing for the 64 bit to 32
bit size difference in the automount(8) code.
Along the way systemd started to use autofs and eventually encountered
this problem too. systemd refused to compensate for the length
difference insisting it be fixed in the kernel. Fortunately Linus
implemented the packetized pipe which resolved the problem in a
straight forward and simple way.
In the autofs mount api conversion series I inadvertatly dropped the
packet pipe flag settings when adding the autofs_parse_fd() function.
This patch fixes that omission.
Fixes: 546694b8f658 ("autofs: add autofs_parse_fd()")
Signed-off-by: Ian Kent <raven(a)themaw.net>
Cc: Bill O'Donnell <bodonnel(a)redhat.com>
Cc: Christian Brauner <brauner(a)kernel.org>
Cc: Arnd Bergmann <arnd(a)arndb.de>
Cc: Dan Carpenter <dan.carpenter(a)linaro.org>
Cc: Anders Roxell <anders.roxell(a)linaro.org>
Cc: Naresh Kamboju <naresh.kamboju(a)linaro.org>
Cc: Stephen Rothwell <sfr(a)canb.auug.org.au>
Reported-by: Linux Kernel Functional Testing <lkft(a)linaro.org>
Reported-by: Anders Roxell <anders.roxell(a)linaro.org>
---
fs/autofs/autofs_i.h | 13 +++++++++----
fs/autofs/inode.c | 2 ++
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/fs/autofs/autofs_i.h b/fs/autofs/autofs_i.h
index 244f18cdf23c..8c1d587b3eef 100644
--- a/fs/autofs/autofs_i.h
+++ b/fs/autofs/autofs_i.h
@@ -221,15 +221,20 @@ static inline int autofs_check_pipe(struct file *pipe)
return 0;
}
-static inline int autofs_prepare_pipe(struct file *pipe)
+static inline void autofs_set_packet_pipe_flags(struct file *pipe)
{
- int ret = autofs_check_pipe(pipe);
- if (ret < 0)
- return ret;
/* We want a packet pipe */
pipe->f_flags |= O_DIRECT;
/* We don't expect -EAGAIN */
pipe->f_flags &= ~O_NONBLOCK;
+}
+
+static inline int autofs_prepare_pipe(struct file *pipe)
+{
+ int ret = autofs_check_pipe(pipe);
+ if (ret < 0)
+ return ret;
+ autofs_set_packet_pipe_flags(pipe);
return 0;
}
diff --git a/fs/autofs/inode.c b/fs/autofs/inode.c
index 6d2e01c9057d..a3d62acc293a 100644
--- a/fs/autofs/inode.c
+++ b/fs/autofs/inode.c
@@ -177,6 +177,8 @@ static int autofs_parse_fd(struct fs_context *fc, struct autofs_sb_info *sbi,
return -EBADF;
}
+ autofs_set_packet_pipe_flags(pipe);
+
if (sbi->pipe)
fput(sbi->pipe);
--
2.41.0
Total jobs: 139
Total errors: 33 (23.74%)
LAVA errors: 0 (0.00%)
Test errors: 33 (23.74%)
Job errors: 0 (0.00%)
Infra errors: 0 (0.00%)
Canceled jobs: 0 (0.00%)
Device type: dragonboard-845c
Total jobs: 85
Total errors: 24 (28.24%)
Error type: Test
Error count: 24 (28.24%)
Error: No match for error type 'Test', message 'The network seems not available, as the ping command failed'
Count: 19 (22.35%)
IDs:
db845c-01:
6954053 6954113 6954121
db845c-02:
6953988 6956898
db845c-04:
6954063 6956897
db845c-06:
6954092
db845c-07:
6953073 6957000
db845c-08:
6953999 6954046 6956382
db845c-09:
6954065 6956998 6957032
db845c-10:
6953985 6953994 6953997
Error: No match for error type 'Test', message 'lava-docker-test-shell timed out after 595 seconds'
Count: 1 (1.18%)
IDs:
db845c-08:
6954098
Error: No match for error type 'Test', message 'tradefed - adb device lost[371c4e67]'
Count: 1 (1.18%)
IDs:
db845c-07:
6954002
Error: No match for error type 'Test', message 'lava-test-interactive timed out after 600 seconds'
Count: 1 (1.18%)
IDs:
db845c-08:
6953986
Error: No match for error type 'Test', message 'tradefed - adb device lost[1028094e]'
Count: 1 (1.18%)
IDs:
db845c-10:
6953975
Error: No match for error type 'Test', message 'tradefed - adb device lost[4f8fceab]'
Count: 1 (1.18%)
IDs:
db845c-08:
6953117
Device type: qrb5165-rb5
Total jobs: 47
Total errors: 8 (17.02%)
Error type: Test
Error count: 8 (17.02%)
Error: No match for error type 'Test', message 'tradefed - adb device lost[74d67c95]'
Count: 2 (4.26%)
IDs:
rb5-03:
6954108 6957008
Error: No match for error type 'Test', message 'tradefed - adb device lost[f11b68eb]'
Count: 1 (2.13%)
IDs:
rb5-05:
6954237
Error: No match for error type 'Test', message 'The network seems not available, as the ping command failed'
Count: 3 (6.38%)
IDs:
rb5-03:
6953087 6954031
rb5-06:
6953065
Error: No match for error type 'Test', message 'tradefed - adb device lost[4fc7b22]'
Count: 2 (4.26%)
IDs:
rb5-06:
6953090 6953093
Device type: x86
Total jobs: 1
Total errors: 0 (0.00%)
Device type: x15
Total jobs: 2
Total errors: 0 (0.00%)
Device type: juno-r2
Total jobs: 1
Total errors: 0 (0.00%)
Device type: dragonboard-410c
Total jobs: 1
Total errors: 0 (0.00%)
Device type: bcm2711-rpi-4-b
Total jobs: 2
Total errors: 1 (50.00%)
Error type: Test
Error count: 1 (50.00%)
Error: lava-test-shell timed out
Count: 1 (50.00%)
IDs:
rpi4-b-01:
6945706