Whamcloud - gitweb
b=5781
authorphil <phil>
Tue, 13 Sep 2005 06:23:13 +0000 (06:23 +0000)
committerphil <phil>
Tue, 13 Sep 2005 06:23:13 +0000 (06:23 +0000)
r=adilger (original patch)

Severity   : minor
Frequency  : rare (only HPUX clients mounting unsupported re-exported NFS vol)
Bugzilla   : 5781
Description: an HPUX NFS client would get -EACCESS when ftruncate()ing a newly
             created file with mode 000
Details    : the Linux NFS server relies on an MDS_OPEN_OWNEROVERRIDE hack to
     allow an ftruncate() as a non-root user to a file with mode 000.
     Lustre now respects this flag to disable mode checks when
     truncating a file owned by the user

lustre/ChangeLog
lustre/mds/mds_reint.c

index 20c2804..9cc52cb 100644 (file)
@@ -66,6 +66,16 @@ Details    : sending a glimpse AST to a liblustre client waits for every AST
             to time out, as liblustre clients will not respond.  Since they
             cannot cache data we refresh the OST lock LVB from disk instead.
 
+Severity   : minor
+Frequency  : rare (only HPUX clients mounting unsupported re-exported NFS vol)
+Bugzilla   : 5781
+Description: an HPUX NFS client would get -EACCESS when ftruncate()ing a newly
+             created file with mode 000
+Details    : the Linux NFS server relies on an MDS_OPEN_OWNEROVERRIDE hack to
+            allow an ftruncate() as a non-root user to a file with mode 000.
+            Lustre now respects this flag to disable mode checks when
+            truncating a file owned by the user
+
 ------------------------------------------------------------------------------
 
 08-26-2005  Cluster File Systems, Inc. <info@clusterfs.com>
index 182836d..215140b 100644 (file)
@@ -225,7 +225,10 @@ int mds_fix_attr(struct inode *inode, struct mds_update_record *rec)
                         RETURN(error);
         }
 
-        if (ia_valid & ATTR_SIZE) {
+        if (ia_valid & ATTR_SIZE &&
+            /* NFSD hack for open(O_CREAT|O_TRUNC)=mknod+truncate (bug 5781) */
+            !(rec->ur_uc.luc_fsuid == inode->i_uid &&
+              ia_valid & MDS_OPEN_OWNEROVERRIDE)) {
                 if ((error = ll_permission(inode, MAY_WRITE, NULL)) != 0)
                         RETURN(error);
         }