Whamcloud - gitweb
Fix POSIX utime.4 -EPERM on FIFO not owned by user.
authoradilger <adilger>
Wed, 24 Sep 2003 00:31:06 +0000 (00:31 +0000)
committeradilger <adilger>
Wed, 24 Sep 2003 00:31:06 +0000 (00:31 +0000)
We don't need to re-check the atime/mtime set flags in fsfilt_ext3_setattr,
we do it already in mds_fix_attr().
b=56

lustre/ChangeLog
lustre/obdclass/fsfilt_ext3.c
lustre/obdclass/fsfilt_extN.c
lustre/obdclass/fsfilt_reiserfs.c

index beff449..5d507ff 100644 (file)
@@ -21,6 +21,7 @@ tbd
        - exit early from mds_open if we get a lookup error (1749)
        - partial page read at EOF wouldn't wait for disk before sending (1642)
        - avoid NULL deref in obdfilter when reading page past EOF (1592)
+       - bug 56: POSIX utime.4 -EPERM on FIFO not owned by user
 
 2003-06-15  Phil Schwan  <phil@clusterfs.com>
        * version v0_7
index c0c839a..89f97e6 100644 (file)
@@ -294,6 +294,10 @@ static int fsfilt_ext3_setattr(struct dentry *dentry, void *handle,
         /* Don't allow setattr to change file type */
         iattr->ia_mode = (inode->i_mode & S_IFMT)|(iattr->ia_mode & ~S_IFMT);
 
+        /* We set these flags on the client, but have already checked perms
+         * so don't confuse inode_change_ok. */
+        iattr->ia_valid &= ~(ATTR_MTIME_SET | ATTR_ATIME_SET);
+
         if (inode->i_op->setattr) {
                 rc = inode->i_op->setattr(dentry, iattr);
         } else {
index ac97d5a..8efc05b 100644 (file)
@@ -288,6 +288,10 @@ static int fsfilt_extN_setattr(struct dentry *dentry, void *handle,
         /* Don't allow setattr to change file type */
         iattr->ia_mode = (inode->i_mode & S_IFMT)|(iattr->ia_mode & ~S_IFMT);
 
+        /* We set these flags on the client, but have already checked perms
+         * so don't confuse inode_change_ok. */
+        iattr->ia_valid &= ~(ATTR_MTIME_SET | ATTR_ATIME_SET);
+
         if (inode->i_op->setattr) {
                 rc = inode->i_op->setattr(dentry, iattr);
         } else {
index 3d118fc..00a670d 100644 (file)
@@ -98,10 +98,18 @@ static int fsfilt_reiserfs_setattr(struct dentry *dentry, void *handle,
                         iattr->ia_mode = inode->i_mode;
                 }
         }
-        if (inode->i_op->setattr)
+
+        /* We set these flags on the client, but have already checked perms
+         * so don't confuse inode_change_ok. */
+        iattr->ia_valid &= ~(ATTR_MTIME_SET | ATTR_ATIME_SET);
+
+        if (inode->i_op->setattr) {
                 rc = inode->i_op->setattr(dentry, iattr);
-        else
-                rc = inode_setattr(inode, iattr);
+        } else {
+                rc = inode_change_ok(inode, iattr);
+                if (!rc)
+                        rc = inode_setattr(inode, iattr);
+        }
 
         unlock_kernel();