diff options
| author | Raghavendra Bhat <raghavendra@redhat.com> | 2016-03-14 15:10:17 -0400 | 
|---|---|---|
| committer | Raghavendra G <rgowdapp@redhat.com> | 2016-03-26 09:33:48 -0700 | 
| commit | 06d50c1c00fe35c6bc2192a392b8a749984f3efc (patch) | |
| tree | f9bd6219e456b3b580e7ff8b2a0ec3973161fd2c /xlators/storage/posix/src/posix.c | |
| parent | 351ec36e3146b7605334cb658927b447b1dbc796 (diff) | |
storage/posix: send proper iatt attributes for the root inode
* changes in posix to send proper iatt attributes for the root directory
  when ancestry is built. Before posix was filling only the gfid and the
  inode type in the iatt structure keeping rest of the fields zeros. This
  was cached by posix-acl and used to send EACCES when some fops came on
  that object if the uid of the caller is same as the uid of the object on
  the disk.
* getting and setting inode_ctx in function 'posix_acl_ctx_get' is not atomic
  and can lead to memory leak when there are multiple looups for an
  inode at same time. This patch fix this problem
* Linking an inode in posix_build_ancestry, can cause a race in
  posix_acl.
  When parent inode is linked in posix_build_ancestry, and before
  it reaches posix_acl_readdirp_cbkc, reate/lookup can
  come on a leaf-inode, as parent-inode-ctx not yet updated
  in posix_acl_readdirp_cbk, create/lookup can fail
  with EACCESS. So do the inode linking in the quota xlator
Change-Id: I3101eefb65551cc4162c4ff2963be1b73deacd6d
BUG: 1320818
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.org/13730
Tested-by: Vijaikumar Mallikarjuna <vmallika@redhat.com>
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src/posix.c')
| -rw-r--r-- | xlators/storage/posix/src/posix.c | 9 | 
1 files changed, 8 insertions, 1 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index dcd54bd35d6..b5df1d082ee 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -3803,11 +3803,18 @@ posix_links_in_same_directory (char *dirpath, int count, inode_t *leaf_inode,                  if (entry->d_ino != stbuf->st_ino)                          continue; +                /* Linking an inode here, can cause a race in posix_acl. +                   Parent inode gets linked here, but before +                   it reaches posix_acl_readdirp_cbk, create/lookup can +                   come on a leaf-inode, as parent-inode-ctx not yet updated +                   in posix_acl_readdirp_cbk, create and lookup can fail +                   with EACCESS. So do the inode linking in the quota xlator +                  linked_inode = inode_link (leaf_inode, parent,                                             entry->d_name, NULL);                  GF_ASSERT (linked_inode == leaf_inode); -                inode_unref (linked_inode); +                inode_unref (linked_inode);*/                  if (type & POSIX_ANCESTRY_DENTRY) {                          loc_t loc = {0, };  | 
