From: Vladimir Saveliev Date: Fri, 8 Oct 2010 09:06:31 +0000 (+0400) Subject: b=22942 check attribute flags correctly X-Git-Tag: 2.0.54.0~42 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;ds=sidebyside;h=b598be8fc36b533f12cfd073413de2005295856a;p=fs%2Flustre-release.git b=22942 check attribute flags correctly i=vitaly --- diff --git a/lustre/liblustre/super.c b/lustre/liblustre/super.c index 916e4c8..297083b 100644 --- a/lustre/liblustre/super.c +++ b/lustre/liblustre/super.c @@ -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) || - (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) diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 0a4db55..c89b9018 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -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) || - (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)