Coda File System

kernel/Venus problem on FreeBSD (was: a possible bug in FreeBSD kernel code?)

From: Ivan Popov <pin_at_medic.chalmers.se>
Date: Fri, 25 Mar 2005 22:03:43 +0100
On Sat, Jan 29, 2005 at 07:49:00PM +0100, Ivan Popov wrote:
> Venus dies with the following diagnostics
> ------------------------------------------------------------------
> 19:25:54 fatal error -- vproc::setattr: no attributes specified
> 19:25:54 RecovTerminate: clean shutdown
> ------------------------------------------------------------------

I found the reason.

install makes 
-------------------------
chown32("<filename>", -1, -1)
-------------------------
when it does not want to change the ownership/group.
It is a perfectly legal no-op (which though may imply some checks
of the existence of the file or alike).

Apparently, it doesn't ever come to Venus on Linux.

FreeBSD sends that call to Venus, and guess what, Venus
checks that there should be at least something that would change
and commits suicide otherwise...

I think the following change would make Venus safer:
------------------------------------------------------------------
--- vproc_vfscalls.cc.ori       2005-03-25 20:50:03.000000000 +0100
+++ vproc_vfscalls.cc   2005-03-25 21:57:51.000000000 +0100
@@ -376,23 +376,25 @@
         (vap->va_flags != VA_IGNORE_FLAGS && vap->va_flags != 0) ||
          (vap->va_bytes != VA_IGNORE_STORAGE) ) {
            u.u_error = EINVAL; 
            return; 
     }
 
+#if 0
     /* Should be setting at least one of these. */
     if ( (vap->va_mode == VA_IGNORE_MODE) &&
         (vap->va_uid == VA_IGNORE_UID) &&
         (vap->va_gid == VA_IGNORE_GID) &&
         (vap->va_size == VA_IGNORE_SIZE) &&
         (vap->va_flags == VA_IGNORE_FLAGS) &&
         (vap->va_atime.tv_sec == VA_IGNORE_TIME1) &&
         (vap->va_mtime.tv_sec == VA_IGNORE_TIME1) &&
         (vap->va_ctime.tv_sec == VA_IGNORE_TIME1) )
 
        CHOKE("vproc::setattr: no attributes specified");
+#endif
 
     for (;;) {
        Begin_VFS(&cp->c_fid, CODA_SETATTR);
        if (u.u_error) break;
 
        /* If we are truncating a file to any non-zero size we NEED the data */
------------------------------------------------------------------

Alternatively, promptly return instead of CHOKE.

Jan, your opinion?

Best regards,
--
Ivan
Received on 2005-03-25 16:06:37