I have been hacking around an NFS problem with Solaris 7 that is probably the same stuff as I did write about on Dec. 12 with Linux. Essentially if I do a mkdir on an NFS filesystem mounted from an AIX 4.1.5 server I get a directory with no permissions and even after doing a chmod it complains that it is not a directory. Pretty strange is that this only happens with the 32 bit version of Solaris 7, if I boot 64 bit the problem does not happen.
As we will need to live with the old AIX NFS server for a while until the new server is in place and I cannot simply recompile as in the Linux case I decided to hack around and intercept the NFS vnode mkdir operation with a small kernel module. For getting this right it was nice to have the Solaris 8 community source handy, so I did not have to do any disassembling. The kernel module calls the previous nfs_mkdir function first and if that did succeed it does do an extra setattr vnode op to set the mode properly and it also patches the newly created vnode type to be a directory.
At the cost of an extra NFS setattr and an additional flush of the NFS attribute cache the hack appears to work quite well, I can properly make directories again! And all this amazingly did work out without any kernel crash or panic, just a few load and unloads of the kernel module until I got all the attributes right.