From: phil Date: Tue, 13 Sep 2005 06:23:13 +0000 (+0000) Subject: b=5781 X-Git-Tag: v1_7_100~1^103~4^2~260^2~103 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=5d516609d8b34052e65fb8531d7f0ffcd958005e;p=fs%2Flustre-release.git b=5781 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 --- diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 20c2804..9cc52cb 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -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. diff --git a/lustre/mds/mds_reint.c b/lustre/mds/mds_reint.c index 182836d..215140b 100644 --- a/lustre/mds/mds_reint.c +++ b/lustre/mds/mds_reint.c @@ -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); }