summaryrefslogtreecommitdiffstats
path: root/fs/orangefs/super.c
diff options
context:
space:
mode:
authorMartin Brandenburg <martin@omnibond.com>2018-02-13 20:13:46 +0000
committerMike Marshall <hubcap@omnibond.com>2019-05-03 14:32:38 -0400
commitafd9fb2a31797b4c787034294a4062df0c19c37e (patch)
tree08bc9f1eaab32d5561519af8f9b1ba2d5ee846ac /fs/orangefs/super.c
parentdf2d7337b570c34e051a2412f716743277ccf9c8 (diff)
orangefs: reorganize setattr functions to track attribute changes
OrangeFS accepts a mask indicating which attributes were changed. The kernel must not set any bits except those that were actually changed. The kernel must set the uid/gid of the request to the actual uid/gid responsible for the change. Code path for notify_change initiated setattrs is orangefs_setattr(dentry, iattr) -> __orangefs_setattr(inode, iattr) In kernel changes are initiated by calling __orangefs_setattr. Code path for writeback is orangefs_write_inode -> orangefs_inode_setattr attr_valid and attr_uid and attr_gid change together under i_lock. I_DIRTY changes separately. __orangefs_setattr lock if needs to be cleaned first, unlock and retry set attr_valid copy data in unlock mark_inode_dirty orangefs_inode_setattr lock copy attributes out unlock clear getattr_time # __writeback_single_inode clears dirty orangefs_inode_getattr # possible to get here with attr_valid set and not dirty lock if getattr_time ok or attr_valid set, unlock and return unlock do server operation # another thread may getattr or setattr, so check for that lock if getattr_time ok or attr_valid, unlock and return else, copy in update getattr_time unlock Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Diffstat (limited to 'fs/orangefs/super.c')
-rw-r--r--fs/orangefs/super.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/fs/orangefs/super.c b/fs/orangefs/super.c
index f27da3bbafac..8fa30c13b7ed 100644
--- a/fs/orangefs/super.c
+++ b/fs/orangefs/super.c
@@ -155,17 +155,8 @@ static void orangefs_destroy_inode(struct inode *inode)
static int orangefs_write_inode(struct inode *inode,
struct writeback_control *wbc)
{
- struct iattr iattr;
gossip_debug(GOSSIP_SUPER_DEBUG, "orangefs_write_inode\n");
- iattr.ia_valid = ATTR_MODE | ATTR_UID | ATTR_GID | ATTR_ATIME |
- ATTR_ATIME_SET | ATTR_MTIME | ATTR_MTIME_SET | ATTR_CTIME;
- iattr.ia_mode = inode->i_mode;
- iattr.ia_uid = inode->i_uid;
- iattr.ia_gid = inode->i_gid;
- iattr.ia_atime = inode->i_atime;
- iattr.ia_mtime = inode->i_mtime;
- iattr.ia_ctime = inode->i_ctime;
- return orangefs_inode_setattr(inode, &iattr);
+ return orangefs_inode_setattr(inode);
}
/*