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/features/marker/src/marker-quota.c | 5 ++++- xlators/features/trash/src/trash.c | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'xlators/features') diff --git a/xlators/features/marker/src/marker-quota.c b/xlators/features/marker/src/marker-quota.c index 167d2dcb59d..7d5bdd847b0 100644 --- a/xlators/features/marker/src/marker-quota.c +++ b/xlators/features/marker/src/marker-quota.c @@ -776,8 +776,10 @@ mq_dirty_inode_readdir (call_frame_t *frame, return 0; } - if (local->fd == NULL) + if (local->fd == NULL) { + fd_bind (fd); local->fd = fd_ref (fd); + } STACK_WIND (frame, mq_readdir_cbk, @@ -3576,6 +3578,7 @@ mq_update_dirty_inode_task (void *opaque) goto out; } + fd_bind (fd); INIT_LIST_HEAD (&entries.list); while ((ret = syncop_readdirp (this, fd, 131072, offset, &entries, NULL, NULL)) != 0) { diff --git a/xlators/features/trash/src/trash.c b/xlators/features/trash/src/trash.c index dafeb183f87..ab008651e1a 100644 --- a/xlators/features/trash/src/trash.c +++ b/xlators/features/trash/src/trash.c @@ -1244,6 +1244,8 @@ trash_truncate_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this, goto out; } + fd_bind (fd); + local->cur_offset = 0; STACK_WIND (frame, trash_truncate_readv_cbk, @@ -1333,6 +1335,7 @@ trash_truncate_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this, goto out; } + fd_bind (fd); flags = O_RDONLY; /* fd which represents source file for reading and writing from it */ -- cgit