From 52e005c450ef0d2de41efb6cb82e6f83d6228976 Mon Sep 17 00:00:00 2001 From: vmallika Date: Tue, 28 Apr 2015 12:52:56 +0530 Subject: quota: Validate NULL inode from the entries received in readdirp_cbk This is a backport of http://review.gluster.org/#/c/10416/ > In quota readdirp_cbk, inode ctx filled for the all entries > received. > In marker readdirp_cbk, files/directories are inspected for > dirty > > There is no guarantee that entry->inode is populated. > If entry->inode is NULL, this needs to be treated as readdir > > Change-Id: Id2d17bb89e4770845ce1f13d73abc2b3c5826c06 > BUG: 1215550 > Signed-off-by: vmallika > Reviewed-on: http://review.gluster.org/10416 > Tested-by: NetBSD Build System > Tested-by: Gluster Build System > Reviewed-by: Raghavendra G > Tested-by: Raghavendra G Change-Id: I6e01b16bae1555efb6c20e49c9c473d81c6d46a0 BUG: 1217406 Signed-off-by: vmallika Reviewed-on: http://review.gluster.org/10468 Reviewed-by: Raghavendra G Tested-by: Gluster Build System Tested-by: NetBSD Build System Reviewed-by: Vijay Bellur --- xlators/features/quota/src/quota.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'xlators/features/quota') diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index 61a68e2464f..d8bacb7924f 100644 --- a/xlators/features/quota/src/quota.c +++ b/xlators/features/quota/src/quota.c @@ -4440,8 +4440,9 @@ quota_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; list_for_each_entry (entry, &entries->list, list) { - if ((strcmp (entry->d_name, ".") == 0) - || (strcmp (entry->d_name, "..") == 0)) + if ((strcmp (entry->d_name, ".") == 0) || + (strcmp (entry->d_name, "..") == 0) || + entry->inode == NULL) continue; gf_uuid_copy (loc.gfid, entry->d_stat.ia_gfid); -- cgit