Just wanted to let you know that I fixed this; commit is here:
https://github.com/joyent/illumos-joyent/commit/af6c46b5dae7a37d78d71546df5045236cd48994 This doesn't address the IN_CREATE issue, which is a much more involved issue -- but should solve the FIONREAD problems... - Bryan On Wed, Dec 10, 2014 at 4:07 PM, Bryan Cantrill <[email protected]> wrote: > > Yeah, that's busted, and I see the bug (we're calculating the size > incorrectly); I'll fix that when I fix FIONREAD -- with my apologies... > > - Bryan > > > On Wed, Dec 10, 2014 at 12:37 PM, Youzhong Yang <[email protected]> > wrote: > >> Hi Bryan, >> >> I saw the bug in the function inotify_ioctl() and tried to fix it. Now >> with my new image ioctl(FIONREAD) returns state->ins_size as the bytes >> available to be read. >> >> [root@batfs5901 ~]# /var/tmp/inotify >> ioctl = 0, errno = 0, bufsize = 64 >> got 48 bytes >> -> New file yyang created >> -> yyang ATTRIB >> >> this state->ins_size seems larger than the number of bytes read by read() >> call, i.e. state->ins_size does not tell the exact number of bytes >> available for read. >> >> This can be a problem when the program expects to read that many bytes. I >> just confirmed it causes issue in Samba. >> >> Thanks, >> >> -- Youzhong >> >> >> On Wed, Dec 10, 2014 at 1:05 PM, Bryan Cantrill <[email protected]> >> wrote: >> >>> >>> The touch differences can be explained by the touch(1) that you're >>> using: in the global zone, you're using /usr/bin/touch, but in the >>> non-global, I imagine that you're using /opt/local/bin/touch. These two >>> implementations differ, so not a huge surprise that their implementation >>> details differ. >>> >>> As for FIONREAD: indeed, that seems screwed up -- it seems to be >>> returning the number of bytes instead of storing in in the specified >>> argument. I'll get that fixed today... >>> >>> - Bryan >>> >>> >>> >>> On Wed, Dec 10, 2014 at 8:00 AM, Youzhong Yang via smartos-discuss < >>> [email protected]> wrote: >>> >>>> Hello again, >>>> >>>> I downloaded smartos latest image (joyent_20141127T173954Z) and tested >>>> inotify using it. >>>> >>>> Two issues were observed: >>>> >>>> 1. ioctl(fd, FIONREAD, ...) does not work as expected. It does not >>>> return the number of bytes that are available to be read on an inotify >>>> instance. >>>> >>>> 2. In an OS zone, touching a file always generates an IN_CREATE event, >>>> even though the file already exists. This only happens in an OS zone, not >>>> in global zone. >>>> >>>> Attached is the test program I used for testing. Just compile and run >>>> it, then in another terminal window, 'touch /tmp/file' twice. Please look >>>> at the details at the end of this e-mail. >>>> >>>> Thanks, >>>> >>>> -Youzhong >>>> >>>> --- In global zone --- >>>> [root@batfs5999 /var/tmp]# ./inotify >>>> ioctl = 64, errno = 0, bufsize = 0 >>>> got 48 bytes >>>> :: mask 256 >>>> -> New file file created >>>> :: mask 4 >>>> -> file ATTRIB >>>> ioctl = 32, errno = 0, bufsize = 0 >>>> got 24 bytes >>>> :: mask 4 >>>> -> file ATTRIB >>>> >>>> --- In OS zone --- >>>> [root@batfs5999-cifs0 /var/tmp]# ./inotify >>>> ioctl = 64, errno = 0, bufsize = 0 >>>> got 48 bytes >>>> :: mask 256 >>>> -> New file file created >>>> :: mask 4 >>>> -> file ATTRIB >>>> ioctl = 64, errno = 0, bufsize = 0 >>>> got 48 bytes >>>> :: mask 256 >>>> -> New file file created >>>> :: mask 4 >>>> -> file ATTRIB >>>> >>>> --- On Linux --- >>>> % ./inotify >>>> ioctl = 0, errno = 0, bufsize = 32 >>>> got 32 bytes >>>> :: mask 256 >>>> -> New file file created >>>> ioctl = 0, errno = 0, bufsize = 32 >>>> got 32 bytes >>>> :: mask 4 >>>> -> file ATTRIB >>>> ioctl = 0, errno = 0, bufsize = 32 >>>> got 32 bytes >>>> :: mask 4 >>>> -> file ATTRIB >>>> >>>> *smartos-discuss* | Archives >>>> <https://www.listbox.com/member/archive/184463/=now> >>>> <https://www.listbox.com/member/archive/rss/184463/21493597-819305a5> >>>> | Modify >>>> <https://www.listbox.com/member/?&> >>>> Your Subscription <http://www.listbox.com> >>>> >>> >>> >> > ------------------------------------------- smartos-discuss Archives: https://www.listbox.com/member/archive/184463/=now RSS Feed: https://www.listbox.com/member/archive/rss/184463/25769125-55cfbc00 Modify Your Subscription: https://www.listbox.com/member/?member_id=25769125&id_secret=25769125-7688e9fb Powered by Listbox: http://www.listbox.com
