summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/storage/posix/src/posix.c')
-rw-r--r--xlators/storage/posix/src/posix.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 27885b8f8c5..a539410bbc2 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -1764,17 +1764,16 @@ posix_unlink (call_frame_t *frame, xlator_t *this,
fdstat_requested = 1;
}
- if (priv->background_unlink || fdstat_requested) {
- if (IA_ISREG (loc->inode->ia_type)) {
- fd = open (real_path, O_RDONLY);
- if (fd == -1) {
- op_ret = -1;
- op_errno = errno;
- gf_msg (this->name, GF_LOG_ERROR, errno,
- P_MSG_OPEN_FAILED,
- "open of %s failed", real_path);
- goto out;
- }
+ if (fdstat_requested ||
+ (priv->background_unlink && IA_ISREG (loc->inode->ia_type))) {
+ fd = open (real_path, O_RDONLY);
+ if (fd == -1) {
+ op_ret = -1;
+ op_errno = errno;
+ gf_msg (this->name, GF_LOG_ERROR, errno,
+ P_MSG_OPEN_FAILED,
+ "open of %s failed", real_path);
+ goto out;
}
}