Re: 4.9.0 regression in pipe-backed iov_iter with systemd-nspawn

Alan J. Wylie
2017-01-12T22:46:16Z

at 14:26 on Thu 12-Jan-2017 Linus Torvalds (torvalds@linux-foundation.org) wrote:

> > Strace shows that the processes are hanging in write() and read() calls.
>
> If this is splice-related, I'm assuming that they aren't actually the
> two ends of the same pipe, and there is somebody doing splice in the
> middle.
>
> I'm not seeing that process. I'm assuming it's systemd. Can you try
> to find it and strace that one too?

strace -f -o /var/tmp/strace.txt systemd-nspawn -q -D /work/chroot.32 --register=no date

full output at
https://wylie.me.uk/tmp/strace.txt

last few lines are:

13766 execve("/bin/date", ["date"], [/* 7 vars */] <unfinished ...>
...
13766 close(2) = 0
13766 exit_group(0) = ?
13766 +++ exited with 0 +++
13761 <... epoll_wait resumed> [{EPOLLIN, {u32=3843638720, u64=94179591538112}}], 7, -1) = 1
13761 clock_gettime(CLOCK_BOOTTIME, {9780, 528425388}) = 0
13761 read(13, "\21\0\0\0\0\0\0\0\1\0\0\0\3065\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 128) = 128
13761 epoll_ctl(11, EPOLL_CTL_DEL, 1, NULL) = 0
13761 epoll_ctl(11, EPOLL_CTL_DEL, 5, NULL) = 0
13761 signalfd4(13, [INT TERM CHLD], 8, SFD_CLOEXEC|SFD_NONBLOCK) = 13
13761 fcntl(0, F_GETFL) = 0 (flags O_RDONLY)
13761 fcntl(1, F_GETFL) = 0x1 (flags O_WRONLY)
13761 kill(13766, SIGKILL) = 0
13761 waitid(P_PID, 13766, {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=13766, si_uid=0, si_status=0, si_utime=0, si_stime=0}, WEXITED, NULL) = 0
13761 close(6) = 0
13761 close(7) = 0
13761 close(8) = 0
13761 close(9) = 0
13761 close(18) = 0
13761 close(16) = 0
13761 close(14) = 0
13761 close(10) = 0
13761 copy_file_range(5, NULL, 1, NULL, 9223372036854775807, 0) = -1 EXDEV (Invalid cross-device link)
13761 sendfile(1, 5, NULL, 9223372036854775807) = -1 EINVAL (Invalid argument)
13761 splice(5, NULL, 1, NULL, 9223372036854775807, 0) = -1 EAGAIN (Resource temporarily unavailable)
13761 open("/run/systemd/nspawn/propagate/chroot.32", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_NOFOLLOW|O_NOATIME|O_CLOEXEC) = 6
13761 fstatfs(6, {f_type=TMPFS_MAGIC, f_bsize=4096, f_blocks=1020327, f_bfree=1015931, f_bavail=1015931, f_files=1020327, f_ffree=1019297, f_fsid={0, 0}, f_namelen=255, f_frsize=4096, f_flags=ST_VALID|ST_NOSUID|ST_NODEV}) = 0
13761 fstat(6, {st_mode=S_IFDIR|0600, st_size=40, ...}) = 0
13761 fcntl(6, F_GETFL) = 0x78800 (flags O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_NOFOLLOW|O_NOATIME)
13761 fcntl(6, F_SETFD, FD_CLOEXEC) = 0
13761 getdents(6, /* 2 entries */, 32768) = 48
13761 getdents(6, /* 0 entries */, 32768) = 0
13761 close(6) = 0
13761 rmdir("/run/systemd/nspawn/propagate/chroot.32") = 0
13761 unlink("/work/.#chroot.32.lck") = 0
13761 close(3) = 0
13761 unlink("/run/systemd/nspawn/locks/inode-65035:24641537") = 0
13761 close(4) = 0
13761 close(5) = 0
13761 exit_group(0) = ?
13761 +++ exited with 0 +++

I'm off to bed now with a stinking head cold I'm afraid.

--
Alan J. Wylie http://www.wylie.me.uk/

Dance like no-one's watching. / Encrypt like everyone is.
Security is inversely proportional to convenience