I'm no Solaris expert, but it seems to me the problem here is that the Solaris vfs doesn't check that remove is not being called on a directory. If this is the case, wouldn't it make sense to do this check in gafs_remove?