I have also been wrestling with CIFS VFS errors when shutting down ubuntu while CIFS shares are mounted. I am currently running Ubuntu & Kubuntu both 7.04 Feisty Fawn 64bit. This script does seem to help however it does not work 100%. I have not thoroughly explored the reasons why sometimes I receive the errors and sometimes do not.
However, extensive googling on the topic revealed an interesting discussion on launchpad here. By combining the information on that thread with how this script works I have come up with two simple commands that appear to work well for me. The underlying causes of these errors may not be the same for you as they are for me however these two commands have resolved my CIFS unmounting problems on every machine I have tested them on:
Perhaps someone more experienced and knowledgable can explain the details but from what I have gathered, the underlying problem is that during ubuntu shutdown the network is stopped before the shares are unmounted. While this script will unmount the shares before the network is stopped, a more elegant solution is to move the existing unmounting process to happen before the network is stopped.. which is what happens by moving S31 to S17.
sudo mv /etc/rc0.d/S31umountnfs.sh /etc/rc0.d/S17umountnfs.sh
sudo mv /etc/rc6.d/S31umountnfs.sh /etc/rc0.d/S17umountnfs.sh