Whamcloud - gitweb
b=22942 check attribute flags correctly
authorVladimir Saveliev <Vladimir.Saveliev@sun.com>
Fri, 8 Oct 2010 09:06:31 +0000 (13:06 +0400)
committerVitaly Fertman <vitaly.fertman@sun.com>
Tue, 12 Oct 2010 22:25:46 +0000 (02:25 +0400)
i=vitaly

lustre/liblustre/super.c
lustre/llite/llite_lib.c

index 916e4c8..297083b 100644 (file)
@@ -767,9 +767,9 @@ int llu_setattr_raw(struct inode *inode, struct iattr *attr)
 
         if (ia_valid & ATTR_SIZE)
                 attr->ia_valid |= ATTR_SIZE;
 
         if (ia_valid & ATTR_SIZE)
                 attr->ia_valid |= ATTR_SIZE;
-        if ((ia_valid & ATTR_SIZE) ||
-            (ia_valid | ATTR_ATIME | ATTR_ATIME_SET) ||
-            (ia_valid | ATTR_MTIME | ATTR_MTIME_SET))
+        if (ia_valid & (ATTR_SIZE |
+                        ATTR_ATIME | ATTR_ATIME_SET |
+                        ATTR_MTIME | ATTR_MTIME_SET))
                 /* on truncate and utimes send attributes to osts, setting
                  * mtime/atime to past will be performed under PW 0:EOF extent
                  * lock (new_size:EOF for truncate)
                 /* on truncate and utimes send attributes to osts, setting
                  * mtime/atime to past will be performed under PW 0:EOF extent
                  * lock (new_size:EOF for truncate)
index 0a4db55..c89b901 100644 (file)
@@ -1277,9 +1277,9 @@ int ll_setattr_raw(struct inode *inode, struct iattr *attr)
 
         if (ia_valid & ATTR_SIZE)
                 attr->ia_valid |= ATTR_SIZE;
 
         if (ia_valid & ATTR_SIZE)
                 attr->ia_valid |= ATTR_SIZE;
-        if ((ia_valid & ATTR_SIZE) ||
-            (ia_valid | ATTR_ATIME | ATTR_ATIME_SET) ||
-            (ia_valid | ATTR_MTIME | ATTR_MTIME_SET))
+        if (ia_valid & (ATTR_SIZE |
+                        ATTR_ATIME | ATTR_ATIME_SET |
+                        ATTR_MTIME | ATTR_MTIME_SET))
                 /* on truncate and utimes send attributes to osts, setting
                  * mtime/atime to past will be performed under PW 0:EOF extent
                  * lock (new_size:EOF for truncate)
                 /* on truncate and utimes send attributes to osts, setting
                  * mtime/atime to past will be performed under PW 0:EOF extent
                  * lock (new_size:EOF for truncate)