From 974be663a9113d4aed684dce00f5288669d511e8 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Sun, 10 Apr 2011 22:38:03 +0000 Subject: features/quota: Add checks for any of the parents of file being NULL while checking limits. Signed-off-by: Raghavendra G Signed-off-by: Anand Avati BUG: 2685 (nfs server crashed in quota_check_limit) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2685 --- xlators/features/quota/src/quota.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'xlators') diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index 80b3a2885..3a2c26daa 100644 --- a/xlators/features/quota/src/quota.c +++ b/xlators/features/quota/src/quota.c @@ -733,6 +733,13 @@ quota_update_size (xlator_t *this, inode_t *inode, char *name, ino_t par, parent = inode_parent (_inode, par, name); + if (parent == NULL) { + gf_log (this->name, GF_LOG_DEBUG, + "cannot find parent for inode (ino:%"PRId64", " + "gfid:%s)", _inode->ino, + uuid_utoa (_inode->gfid)); + } + if (name != NULL) { name = NULL; par = 0; @@ -741,6 +748,10 @@ quota_update_size (xlator_t *this, inode_t *inode, char *name, ino_t par, inode_unref (_inode); _inode = parent; + if (_inode == NULL) { + break; + } + inode_ctx_get (_inode, this, &value); ctx = (quota_inode_ctx_t *)(unsigned long)value; } while (1); -- cgit