Skip to contentSkip to conversation

Staging: lustre: missing curly braces in ll_setattr_raw()

PATCH In review Dan Carpenter 2 participants 2 messages Feb 25, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: lustre: missing curly braces in ll_setattr_raw()

From the indenting, it looks like curly braces were intended here.

---
This is not tested, and it changes how the code works. Please review it a bit carefully. Sometimes people just do weird indenting for no reason.

drivers/staging/lustre/lustre/llite/llite_lib.c +2 -1
index 0c1b583..ba97d9e 100644
@@ -1432,7 +1432,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr, bool hsm_import)
 
 	if (attr->ia_valid & (ATTR_SIZE |
 			      ATTR_ATIME | ATTR_ATIME_SET |
-			      ATTR_MTIME | ATTR_MTIME_SET))
+			      ATTR_MTIME | ATTR_MTIME_SET)) {
 		/* For truncate and utimes sending attributes to OSTs, setting
 		 * mtime/atime to the past will be performed under PW [0:EOF]
 		 * extent lock (new_size:EOF for truncate).  It may seem
@@ -1444,6 +1444,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr, bool hsm_import)
 		rc = ll_setattr_ost(inode, attr);
 		if (attr->ia_valid & ATTR_SIZE)
 			up_write(&lli->lli_trunc_sem);
+	}
 out:
 	if (op_data) {
 		if (op_data->op_ioepoch) {
#1 lore raw

Ah!
Nice catch.
I am not sure how I missed that while making 178ba1e0d00aca671f9a8f5f41d28fc0fe717752, it's also strange that this never triggered any ill effects in any of my testing.

Thanks!

Quoted 29 lines · Dan Carpenter

From the indenting, it looks like curly braces were intended here.

---
This is not tested, and it changes how the code works. Please review it a bit carefully. Sometimes people just do weird indenting for no reason.

drivers/staging/lustre/lustre/llite/llite_lib.c +2 -1
index 0c1b583..ba97d9e 100644
@@ -1432,7 +1432,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr, bool hsm_import)
 
 	if (attr->ia_valid & (ATTR_SIZE |
 			      ATTR_ATIME | ATTR_ATIME_SET |
-			      ATTR_MTIME | ATTR_MTIME_SET))
+			      ATTR_MTIME | ATTR_MTIME_SET)) {
 		/* For truncate and utimes sending attributes to OSTs, setting
 		 * mtime/atime to the past will be performed under PW [0:EOF]
 		 * extent lock (new_size:EOF for truncate).  It may seem
@@ -1444,6 +1444,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr, bool hsm_import)
 		rc = ll_setattr_ost(inode, attr);
 		if (attr->ia_valid & ATTR_SIZE)
 			up_write(&lli->lli_trunc_sem);
+	}

out:

	if (op_data) {
		if (op_data->op_ioepoch) {