Distribution: gentoo 2005.0 Hardware Environment: x86 Software Environment: glibc Problem Description: If a signal interrupts getdents (atleast with smbfs), the result is often empty, here is output from strace. open("/home/stian/server-audio/a/1/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 11 fstat64(11, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 fcntl64(11, F_SETFD, FD_CLOEXEC) = 0 getdents(11, 0x832bafc, 4096) = ? ERESTARTSYS (To be restarted) --- SIGALRM (Alarm clock) @ 0 (0) --- gettimeofday({1113539488, 457225}, NULL) = 0 ioctl(10, SNDCTL_DSP_GETODELAY or SNDCTL_DSP_PROFILE, 0xbfffc760) = 0 ioctl(10, SNDCTL_DSP_GETOSPACE, 0xbfffc764) = 0 write(10, "\347\377{\341\'\375\240\3405\372\6\341\210\367\365\342"..., 2904) = 2904 getitimer(ITIMER_REAL, {it_interval={0, 14997}, it_value={0, 13997}}) = 0 gettimeofday({1113539488, 458598}, NULL) = 0 sigreturn() = ? (mask now []) getdents(11, /* 0 entries */, 4096) = 0 Steps to reproduce: setitimer() and try to use diropen()/readdir() alot until it is interrupted by a SIGALRM. Happens alot if the source-filesystem is smbfs atleast.
Created attachment 6389 [details] smbfs-readdir-vs-signal-fix Could you please test this putative fix?
ping?
I'm sorry, been a bit busy and I forgot about it. I'll regression-tests on it tonight after work.
I patched it in last night (against vanilla 2.6.15), and tested it this morning with localhost as server. Problem did not occure a single time with this patch in. Did get some other non-related messages in my syslog: Jan 17 11:25:43 gentoo-2 smb_proc_readdir_long: error=-512, breaking Jan 17 11:25:43 gentoo-2 smb_proc_readdir_long: error=-512, breaking Jan 17 11:25:43 gentoo-2 smb_proc_readdir_long: error=-512, breaking Everything seems to work well now. I'll try to remove patch again to night to see if problem re-occures with 2.6.15 vanilla. Project I'm testing it with is Open Cubic Player, as it uses a SIGALRM for background scheduling of sound.
Great, thanks. I'll merge it.