[K42-discussion] sysfs lseek patch

Patrick Bozeman PEBozeman at lbl.gov
Thu Feb 16 07:29:29 EST 2006


I'm still looking into G5 thermal control, but while doing so, I ran
into a bug in the K42 sysfs implementation.  While it works fine for
doing things like 'cat /sys/foo' it was causing baseServers to assert
when I would try to sample the temperature sensors via a perl program. 
Perl calls lseek on files prior to reading them, and the k42
ServerFileVirtFS implementation in libc/fslib was asserting because it
appears to be out of sync with the sysfs implementation in lib/lk. 

The SysFS implementation in lib/lk returns success, which isn't handled
by ServerFileVirtFS prior to the patch.   I changed the logic in
ServerFileVirtFS to accept both success and ENOSYS.  I also provided
ServerFileVirtFS with a full setFilePosition implementation by making a
call ServerFile's version after the dref'd call is made.

I also removed a warning in the FileLinuxVirtFile implementation about
unsupported ioctl's.   The console was getting spammed with these during
my sampling loop, and they seem unnecessary as the linux sysfs doesn't
support ioctls either.

I'm still sort of stumbling around inside K42, so while this seems to
work for sysfs, I'm not sure about other related code to consider. 

Can someone take a look at the patch and consider committing it? 

Thanks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: k42-sysfs-seek.patch
Type: text/x-patch
Size: 2182 bytes
Desc: not available
Url : http://ozlabs.org/pipermail/k42-discussion/attachments/20060215/0b03062a/attachment.bin 


More information about the K42-discussion mailing list