From c3dd76e9da783d879258cde17680f7d8747506f8 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Tue, 2 Jun 2015 16:39:35 +0530 Subject: fd: Do fd_bind on successful open - fd_unref should decrement fd->inode->fd_count only if it is present in the inode's fd list. - successful open/opendir should perform fd_bind. >Change-Id: I81dd04f330e2fee86369a6dc7147af44f3d49169 >BUG: 1207735 >Signed-off-by: Pranith Kumar K >Reviewed-on: http://review.gluster.org/11044 >Reviewed-by: Anoop C S >Tested-by: NetBSD Build System >Tested-by: Gluster Build System >Reviewed-by: Raghavendra G BUG: 1259697 Change-Id: I73b79dd3519aa085fb84dde74b321511cbccce1a Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/12100 Tested-by: Gluster Build System Tested-by: NetBSD Build System Reviewed-by: Raghavendra G --- xlators/encryption/crypt/src/crypt.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'xlators/encryption/crypt/src/crypt.c') diff --git a/xlators/encryption/crypt/src/crypt.c b/xlators/encryption/crypt/src/crypt.c index 5387f84303c..57ae72731ba 100644 --- a/xlators/encryption/crypt/src/crypt.c +++ b/xlators/encryption/crypt/src/crypt.c @@ -1833,7 +1833,9 @@ static int32_t truncate_begin(call_frame_t *frame, op_ret, op_errno, NULL, NULL, NULL); return 0; - } + } else { + fd_bind (fd); + } /* * crypt_truncate() is implemented via crypt_ftruncate(), * so the crypt xlator does STACK_WIND to itself here @@ -3095,7 +3097,7 @@ static int32_t do_linkop(call_frame_t *frame, &lock, NULL); return 0; - error: + error: unwind_fn(frame); return 0; } @@ -3125,11 +3127,14 @@ static int32_t linkop_begin(call_frame_t *frame, unwind_fn = linkop_unwind_dispatch(local->fop); mop = linkop_mtdop_dispatch(local->fop); - if (op_ret < 0) + if (op_ret < 0) { /* * verification failed */ goto error; + } else { + fd_bind (fd); + } old_mtd = dict_get(xdata, CRYPTO_FORMAT_PREFIX); if (!old_mtd) { -- cgit