diff options
author | Raghavendra G <raghavendra@gluster.com> | 2011-04-10 22:38:03 +0000 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-04-11 05:43:52 -0700 |
commit | 974be663a9113d4aed684dce00f5288669d511e8 (patch) | |
tree | 2859e63d5362d147ecb5a6323f1bc9e35fa22cdc /xlators/features/quota | |
parent | 1992dc12443f376f9b2974f4e830b4b17e3574c0 (diff) |
features/quota: Add checks for any of the parents of file being NULL while checking limits.
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Signed-off-by: Anand Avati <avati@gluster.com>
BUG: 2685 (nfs server crashed in quota_check_limit)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2685
Diffstat (limited to 'xlators/features/quota')
-rw-r--r-- | xlators/features/quota/src/quota.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index 80b3a2885eb..3a2c26daa50 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); |