summaryrefslogtreecommitdiffstats
path: root/xlators/storage
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2015-12-21 14:18:26 +0530
committerDan Lambright <dlambrig@redhat.com>2016-02-22 06:52:15 -0800
commit28f561b1855d118202de3a6d454d688c1ccb9e6e (patch)
treec8ae31536478b77a2fefcf939b559cf13a33ee01 /xlators/storage
parent830f6ebe7462aef6b190c63d7c49288501283ab3 (diff)
tier/unlink: open fd for special file for fdstat
DUring unlink of a file, dht request stat to see whether the file is under migration or not. But in posix_unlink currently we are opening for regular files. so the fdstat for special files are failing with EBAD backport of> >Change-Id: Ic0678e42e7701c3dffb91d98272e664b0fc646b5 >BUG: 1293256 >Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> >Reviewed-on: http://review.gluster.org/13034 >Reviewed-by: Raghavendra G <rgowdapp@redhat.com> >Reviewed-by: Susant Palai <spalai@redhat.com> >Tested-by: NetBSD Build System <jenkins@build.gluster.org> >Reviewed-by: Dan Lambright <dlambrig@redhat.com> >Tested-by: Dan Lambright <dlambrig@redhat.com> Change-Id: Ibad6e97cb052f779520968f0dce15b6fa78a5e1a BUG: 1295360 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/13164 Smoke: Gluster Build System <jenkins@build.gluster.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Diffstat (limited to 'xlators/storage')
-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;
}
}