Commit a1a862b7 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] kill lock_kernel() in inode_setattr()

All we're doing in there is writing things into the inode.  I see no need for
the lock_kernel().

And holding lock_kernel() across mark_inode_dirty() hurts on big SMP.
parent 97b6cac7
No related merge requests found
...@@ -81,7 +81,6 @@ int inode_setattr(struct inode * inode, struct iattr * attr) ...@@ -81,7 +81,6 @@ int inode_setattr(struct inode * inode, struct iattr * attr)
} }
} }
lock_kernel();
if (ia_valid & ATTR_UID) if (ia_valid & ATTR_UID)
inode->i_uid = attr->ia_uid; inode->i_uid = attr->ia_uid;
if (ia_valid & ATTR_GID) if (ia_valid & ATTR_GID)
...@@ -93,12 +92,13 @@ int inode_setattr(struct inode * inode, struct iattr * attr) ...@@ -93,12 +92,13 @@ int inode_setattr(struct inode * inode, struct iattr * attr)
if (ia_valid & ATTR_CTIME) if (ia_valid & ATTR_CTIME)
inode->i_ctime = attr->ia_ctime; inode->i_ctime = attr->ia_ctime;
if (ia_valid & ATTR_MODE) { if (ia_valid & ATTR_MODE) {
inode->i_mode = attr->ia_mode; umode_t mode = attr->ia_mode;
if (!in_group_p(inode->i_gid) && !capable(CAP_FSETID)) if (!in_group_p(inode->i_gid) && !capable(CAP_FSETID))
inode->i_mode &= ~S_ISGID; mode &= ~S_ISGID;
inode->i_mode = mode;
} }
mark_inode_dirty(inode); mark_inode_dirty(inode);
unlock_kernel();
out: out:
return error; return error;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment