Chris Gerhard wrote:
Alan Wright wrote:
If the engine has been restarted, the socket should get closed
or return an error on the read.  A zero length read isn't
necessarily a problem, and the vscan code is retrying the read
because it is expecting more data.

While vscand is expecting more data it is never going to arrive down that fd as a read returning zero bytes signifies EOF and will never get any more data. If the stream was marked for non blocking IO it would have returned -1 with errno set otherwise it will block until there is data or return 0 if there has been a hangup, ie the other end of the stream is closed.

Yep, feel free to file the bug.
Don't worry about the network capture.

Alan

If you file a bug, please attach a network capture showing the
interaction when the problem occurs.

ok.



Thanks,

Alan

Chris Gerhard wrote:
My home server's vscand just got itself into a loop consuming a CPU while read returned 0 bytes.

A bit of D got the stack where it was doing this:

  0   3910                      read:return
              libc.so.1`__read+0x7
              vscand`vs_icap_read+0x25
              vscand`vs_icap_send_chunk+0x3e
              vscand`vs_icap_respmod_request+0xcf
              vscand`vs_icap_scan_file+0x184
              vscand`vs_svc_scan_file+0xd1
              vscand`vs_svc_async_scan+0x22
              libc.so.1`_thrp_setup+0x9b
              libc.so.1`_lwp_start

  0   3910                      read:return
              libc.so.1`__read+0x7
              vscand`vs_icap_read+0x25
              vscand`vs_icap_send_chunk+0x3e
              vscand`vs_icap_respmod_request+0xcf
              vscand`vs_icap_scan_file+0x184
              vscand`vs_svc_scan_file+0xd1
              vscand`vs_svc_async_scan+0x22
              libc.so.1`_thrp_setup+0x9b
              libc.so.1`_lwp_start

Unfortunately I did not get the name of the file is was reading (although I suspect it was a network connection).

The source confirms that it can't handle a return of 0 bytes:

   1173 vs_icap_read(int fd, char *buf, int len)
   1174 {
   1175     char *ptr = buf;
   1176     int resid = len;
   1177     int bytes_read = 0;
   1178
   1179     while (resid > 0) {
   1180         errno = 0;
   1181         bytes_read = read(fd, ptr, resid);
   1182         if (bytes_read < 0) {
   1183             if (errno == EINTR)
   1184                 continue;
   1185             else
   1186                 return (-1);
   1187         }
   1188         resid -= bytes_read;
   1189         ptr += bytes_read;
   1190     }
   1191
   1192     return (len - resid);
   1193 }

I suspect the problem coincides with a virus engine being restarted.

I'll file a bug next week when I'm back in the office.






_______________________________________________
cifs-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/cifs-discuss

Reply via email to