Skip to content

Commit

Permalink
Merge branch 'tp/lwr_spec' into ibm_next_tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
Venkateswararao Jujjuri committed May 9, 2012
2 parents d7ee607 + a7ea564 commit 4f3456f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
15 changes: 10 additions & 5 deletions src/Cache_inode/cache_inode_readdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ cache_inode_readdir_populate(cache_entry_t *directory,
if(FSAL_IS_ERROR(fsal_status))
{
*status = cache_inode_error_convert(fsal_status);
return *status;
goto bail;
}

for(iter = 0; iter < found; iter++)
Expand Down Expand Up @@ -514,7 +514,7 @@ cache_inode_readdir_populate(cache_entry_t *directory,
if (fsal_status.major == ERR_FSAL_STALE) {
cache_inode_kill_entry(directory, client);
}
return *status;
goto bail;
}
}
else
Expand All @@ -540,8 +540,7 @@ cache_inode_readdir_populate(cache_entry_t *directory,
context,
CACHE_INODE_FLAG_NONE,
status)) == NULL)
return *status;

goto bail;
cache_status
= cache_inode_add_cached_dirent(directory,
&(array_dirent[iter].name),
Expand All @@ -557,7 +556,7 @@ cache_inode_readdir_populate(cache_entry_t *directory,

if(cache_status != CACHE_INODE_SUCCESS
&& cache_status != CACHE_INODE_ENTRY_EXISTS)
return *status;
goto bail;

/*
* Remember the FSAL readdir cookie associated with this
Expand Down Expand Up @@ -597,6 +596,12 @@ cache_inode_readdir_populate(cache_entry_t *directory,
CACHE_INODE_TRUST_CONTENT));
*status = CACHE_INODE_SUCCESS;
return *status;

bail:
/* Close the directory */
FSAL_closedir(&dir_handle);
return *status;

} /* cache_inode_readdir_populate */

/**
Expand Down
8 changes: 6 additions & 2 deletions src/FSAL/FSAL_GPFS/fsal_dirs.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ fsal_status_t GPFSFSAL_opendir(fsal_handle_t * p_dir_handle, /* IN */
/* get directory metadata */
dir_attrs.asked_attributes = GPFS_SUPPORTED_ATTRIBUTES;
status = GPFSFSAL_getattrs(p_dir_handle, p_context, &dir_attrs);
if(FSAL_IS_ERROR(status))
if(FSAL_IS_ERROR(status)) {
close(p_dir_descriptor->fd);
ReturnStatus(status, INDEX_FSAL_opendir);
}

/* Test access rights for this directory */

Expand All @@ -86,8 +88,10 @@ fsal_status_t GPFSFSAL_opendir(fsal_handle_t * p_dir_handle, /* IN */
else
status = fsal_internal_access(p_context, p_dir_handle, access_mask,
&dir_attrs);
if(FSAL_IS_ERROR(status))
if(FSAL_IS_ERROR(status)) {
close(p_dir_descriptor->fd);
ReturnStatus(status, INDEX_FSAL_opendir);
}

/* if everything is OK, fills the dir_desc structure : */

Expand Down

0 comments on commit 4f3456f

Please sign in to comment.