From 3ab5d0672c7ef8a46e1b711e1593748bed407d32 Mon Sep 17 00:00:00 2001 From: Varun Shastry Date: Wed, 23 Oct 2013 16:10:31 +0530 Subject: features/quota: Correct the statfs calculation when set limit is beyond ... actual disk space. Fixed one of the cases where 'df' values data show wrong when the quota limit is greater than back-end disk space. Change-Id: I09fb71a37602c6f3daf6b91dd3fd19b7f5f76817 BUG: 969461 Signed-off-by: Varun Shastry Reviewed-on: http://review.gluster.org/6126 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/features/quota/src/quota.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'xlators/features') diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index 2812a2b13..416d9ce65 100644 --- a/xlators/features/quota/src/quota.c +++ b/xlators/features/quota/src/quota.c @@ -3561,11 +3561,9 @@ quota_statfs_cbk (call_frame_t *frame, void *cookie, xlator_t *this, buf->f_blocks = blocks; avail = buf->f_blocks - usage; - avail = (avail >= 0) ? avail : 0; + avail = max (avail, 0); - if (buf->f_bfree > avail) { - buf->f_bfree = avail; - } + buf->f_bfree = avail; /* * We have to assume that the total assigned quota * won't cause us to dip into the reserved space, -- cgit From 410fe979b4e2492f04e9cc8949f5ef5041e1135a Mon Sep 17 00:00:00 2001 From: Poornima Date: Thu, 23 Jan 2014 22:55:45 +0000 Subject: features/qemu-block: Remove unref of freed iobuf Change-Id: I507a6504b379eef54be77b54d6e2beee63975ebf BUG: 789278 Signed-off-by: Poornima Reviewed-on: http://review.gluster.org/6824 Tested-by: Gluster Build System Reviewed-by: Raghavendra Talur Reviewed-by: Anand Avati --- xlators/features/qemu-block/src/bdrv-xlator.c | 1 - 1 file changed, 1 deletion(-) (limited to 'xlators/features') diff --git a/xlators/features/qemu-block/src/bdrv-xlator.c b/xlators/features/qemu-block/src/bdrv-xlator.c index aaf028cfe..1e55b5fb7 100644 --- a/xlators/features/qemu-block/src/bdrv-xlator.c +++ b/xlators/features/qemu-block/src/bdrv-xlator.c @@ -235,7 +235,6 @@ qemu_gluster_co_writev (BlockDriverState *bs, int64_t sector_num, int nb_sectors iobref = iobref_new (); if (!iobref) { - iobuf_unref (iobuf); goto out; } -- cgit From 922134fdc08afb2810cb0205f26693d36db6fd4e Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Tue, 28 Jan 2014 15:16:59 +0530 Subject: cluster/afr: Add gfid to index in wind un-conditionally Problem: If brick crashes just after performing xattrop before reaching index _cbk then the gfid will not be added to/deleted from index. If it is not deleted it will be deleted when self-heal is triggered. But if the crash happens before the file is added to index, user may think the system does not need self-heal even when there is this file that needs to be healed. Fix: Add file to index un-conditionally in wind phase. This way the file remains in index even when brick process crashes before reaching _cbk. This does not affect performance because of caching(check _index_action) built into index xlator. Change-Id: Ie83ac6aa1ac0ff66862e757864865b47ab39404d BUG: 1058713 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/6836 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/features/index/src/index.c | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) (limited to 'xlators/features') diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c index db592719b..ce037aa24 100644 --- a/xlators/features/index/src/index.c +++ b/xlators/features/index/src/index.c @@ -655,22 +655,16 @@ _check_key_is_zero_filled (dict_t *d, char *k, data_t *v, return 0; } - void -_xattrop_index_action (xlator_t *this, inode_t *inode, dict_t *xattr) +_index_action (xlator_t *this, inode_t *inode, gf_boolean_t zero_xattr) { - gf_boolean_t zero_xattr = _gf_true; + int ret = 0; index_inode_ctx_t *ctx = NULL; - int ret = 0; - - ret = dict_foreach (xattr, _check_key_is_zero_filled, NULL); - if (ret == -1) - zero_xattr = _gf_false; ret = index_inode_ctx_get (inode, this, &ctx); if (ret) { gf_log (this->name, GF_LOG_ERROR, "Not able to %s %s -> index", - zero_xattr?"add":"del", uuid_utoa (inode->gfid)); + zero_xattr?"del":"add", uuid_utoa (inode->gfid)); goto out; } if (zero_xattr) { @@ -690,6 +684,19 @@ out: return; } +void +_xattrop_index_action (xlator_t *this, inode_t *inode, dict_t *xattr) +{ + gf_boolean_t zero_xattr = _gf_true; + int ret = 0; + + ret = dict_foreach (xattr, _check_key_is_zero_filled, NULL); + if (ret == -1) + zero_xattr = _gf_false; + _index_action (this, inode, zero_xattr); + return; +} + void fop_xattrop_index_action (xlator_t *this, inode_t *inode, dict_t *xattr) { @@ -868,6 +875,11 @@ int index_xattrop_wrapper (call_frame_t *frame, xlator_t *this, loc_t *loc, gf_xattrop_flags_t optype, dict_t *xattr, dict_t *xdata) { + //In wind phase bring the gfid into index. This way if the brick crashes + //just after posix performs xattrop before _cbk reaches index xlator + //we will still have the gfid in index. + _index_action (this, frame->local, _gf_false); + STACK_WIND (frame, index_xattrop_cbk, FIRST_CHILD (this), FIRST_CHILD (this)->fops->xattrop, loc, optype, xattr, xdata); @@ -878,6 +890,10 @@ int index_fxattrop_wrapper (call_frame_t *frame, xlator_t *this, fd_t *fd, gf_xattrop_flags_t optype, dict_t *xattr, dict_t *xdata) { + //In wind phase bring the gfid into index. This way if the brick crashes + //just after posix performs xattrop before _cbk reaches index xlator + //we will still have the gfid in index. + _index_action (this, frame->local, _gf_false); STACK_WIND (frame, index_fxattrop_cbk, FIRST_CHILD (this), FIRST_CHILD (this)->fops->fxattrop, fd, optype, xattr, xdata); -- cgit From 33e9e8fcb98cd8ddd483b37ff7114ea9fd8d75fb Mon Sep 17 00:00:00 2001 From: Lalatendu Mohanty Date: Tue, 21 Jan 2014 02:27:03 +0530 Subject: quota: Fixing a possibility of GF_FREE on an array pointer Issue: when the charecter pointer is not heap allocated by the program we should not do GF_FREE on it. Change-Id: Ibccc25491a9ab924fd5b82c14566f551a061ec2e BUG: 789278 Signed-off-by: Lalatendu Mohanty Reviewed-on: http://review.gluster.org/6741 Reviewed-by: Raghavendra G Reviewed-by: Vijay Bellur Tested-by: Gluster Build System --- xlators/features/quota/src/quota.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'xlators/features') diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index 416d9ce65..a8b4eb2c3 100644 --- a/xlators/features/quota/src/quota.c +++ b/xlators/features/quota/src/quota.c @@ -4027,6 +4027,7 @@ quota_log_usage (xlator_t *this, quota_inode_ctx_t *ctx, inode_t *inode, char *path = NULL; int64_t cur_size = 0; quota_priv_t *priv = NULL; + gf_boolean_t dyn_mem = _gf_true; priv = this->private; if ((ctx->soft_lim <= 0) || (timerisset (&ctx->prev_log) && @@ -4041,6 +4042,7 @@ quota_log_usage (xlator_t *this, quota_inode_ctx_t *ctx, inode_t *inode, if (!usage_str) { snprintf (size_str, sizeof (size_str), "%"PRId64, cur_size); usage_str = (char*) size_str; + dyn_mem = _gf_false; } inode_path (inode, NULL, &path); if (!path) @@ -4061,7 +4063,8 @@ quota_log_usage (xlator_t *this, quota_inode_ctx_t *ctx, inode_t *inode, ctx->prev_log = cur_time; } - GF_FREE (usage_str); + if (dyn_mem) + GF_FREE (usage_str); } int32_t -- cgit From 21a83b8be06aa73f40b83b9cfc97dc8a1972190a Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Mon, 27 Jan 2014 17:49:29 -0600 Subject: features/index: Loop exit without freeing in-use memory. If the while loop is exited via the goto, the call to closedir(3) is skipped, leaving an open directory stream. This patch ensure that the directory is closed if the loop is exited via the goto. BUG: 789278 CID: 1124763 Change-Id: Iec5da4b8d32c0a93c10d035ff38d0c063fd97cda Signed-off-by: Christopher R. Hertel Reviewed-on: http://review.gluster.org/6828 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/features/index/src/index.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'xlators/features') diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c index ce037aa24..ec395e8a4 100644 --- a/xlators/features/index/src/index.c +++ b/xlators/features/index/src/index.c @@ -490,8 +490,10 @@ sync_base_indices_from_xattrop (xlator_t *this) continue; } ret = unlink (entry->d_name); - if (ret) + if (ret) { + closedir (dir); goto out; + } } closedir (dir); } -- cgit From 3bc23e1ad08e212538d325ec0196ec7488ae7e62 Mon Sep 17 00:00:00 2001 From: Raghavendra Talur Date: Thu, 30 Jan 2014 19:50:06 +0530 Subject: changelog: Restrict length of unix socket files to UNIX_PATH_MAX. Bug fix for Coverity-CID 1124847. Change-Id: I410ef8e06cbc491b1f72535298fae5e9bc77220d BUG: 789278 Signed-off-by: Raghavendra Talur Reviewed-on: http://review.gluster.org/6870 Reviewed-by: Venky Shankar Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/features/changelog/lib/src/gf-changelog-helpers.h | 2 +- xlators/features/changelog/lib/src/gf-changelog.c | 2 +- xlators/features/changelog/src/changelog-helpers.h | 2 +- xlators/features/changelog/src/changelog-notifier.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'xlators/features') diff --git a/xlators/features/changelog/lib/src/gf-changelog-helpers.h b/xlators/features/changelog/lib/src/gf-changelog-helpers.h index 3aa6ed7b8..7e13d9376 100644 --- a/xlators/features/changelog/lib/src/gf-changelog-helpers.h +++ b/xlators/features/changelog/lib/src/gf-changelog-helpers.h @@ -51,7 +51,7 @@ typedef struct gf_changelog { /* connection retries */ int gfc_connretries; - char gfc_sockpath[PATH_MAX]; + char gfc_sockpath[UNIX_PATH_MAX]; char gfc_brickpath[PATH_MAX]; diff --git a/xlators/features/changelog/lib/src/gf-changelog.c b/xlators/features/changelog/lib/src/gf-changelog.c index ca8e373e7..1b014640e 100644 --- a/xlators/features/changelog/lib/src/gf-changelog.c +++ b/xlators/features/changelog/lib/src/gf-changelog.c @@ -173,7 +173,7 @@ gf_changelog_notification_init (xlator_t *this, gf_changelog_t *gfc) } CHANGELOG_MAKE_SOCKET_PATH (gfc->gfc_brickpath, - gfc->gfc_sockpath, PATH_MAX); + gfc->gfc_sockpath, UNIX_PATH_MAX); gf_log (this->name, GF_LOG_INFO, "connecting to changelog socket: %s (brick: %s)", gfc->gfc_sockpath, gfc->gfc_brickpath); diff --git a/xlators/features/changelog/src/changelog-helpers.h b/xlators/features/changelog/src/changelog-helpers.h index 16d60b99b..b441f7068 100644 --- a/xlators/features/changelog/src/changelog-helpers.h +++ b/xlators/features/changelog/src/changelog-helpers.h @@ -125,7 +125,7 @@ typedef struct changelog_notify { pthread_t notify_th; /* unique socket path */ - char sockpath[PATH_MAX]; + char sockpath[UNIX_PATH_MAX]; int socket_fd; diff --git a/xlators/features/changelog/src/changelog-notifier.c b/xlators/features/changelog/src/changelog-notifier.c index 1f8b31253..5f3d063a8 100644 --- a/xlators/features/changelog/src/changelog-notifier.c +++ b/xlators/features/changelog/src/changelog-notifier.c @@ -178,7 +178,7 @@ changelog_notifier (void *data) } CHANGELOG_MAKE_SOCKET_PATH (priv->changelog_brick, - cn->sockpath, PATH_MAX); + cn->sockpath, UNIX_PATH_MAX); if (unlink (cn->sockpath) < 0) { if (errno != ENOENT) { gf_log (this->name, GF_LOG_ERROR, -- cgit From 432f7e45b2ddf511660d269548f248217a2b45ad Mon Sep 17 00:00:00 2001 From: Raghavendra Talur Date: Tue, 4 Feb 2014 15:57:05 +0530 Subject: changelog: When connection is unsuccessful, close socket too. Bug fix for Coverity CID: 1124791 Change-Id: I0362d45123ebc250290f3a5231f7fb113fa41212 BUG: 789278 Signed-off-by: Raghavendra Talur Reviewed-on: http://review.gluster.org/6900 Reviewed-by: Krishnan Parthasarathi Reviewed-by: Santosh Pradhan Reviewed-by: Venky Shankar Tested-by: Gluster Build System --- xlators/features/changelog/lib/src/gf-changelog.c | 1 + 1 file changed, 1 insertion(+) (limited to 'xlators/features') diff --git a/xlators/features/changelog/lib/src/gf-changelog.c b/xlators/features/changelog/lib/src/gf-changelog.c index 1b014640e..4b2b25ad5 100644 --- a/xlators/features/changelog/lib/src/gf-changelog.c +++ b/xlators/features/changelog/lib/src/gf-changelog.c @@ -202,6 +202,7 @@ gf_changelog_notification_init (xlator_t *this, gf_changelog_t *gfc) gf_log (this->name, GF_LOG_ERROR, "could not connect to changelog socket!" " bailing out..."); + close (sockfd); ret = -1; } else gf_log (this->name, GF_LOG_INFO, -- cgit From 13b68bc693e92378f78f452763a6097bf1755072 Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Fri, 31 Jan 2014 12:13:30 -0600 Subject: features/index: Close directories left open on error. Two directory streams are opened, but not always closed if the function exits with an error. This patch aims to ensure that the directories are closed in call cases. Some return values may be explicitly discarded. This is done to avoid having a successful call to closedir() overwrite the value of ret. Also, the errno value is preserved in case a calling function needs to check errno. BUG: 789278 CID: 1124710 CID: 1124711 Change-Id: I6bf3b5c9c6a1ec9a99cc9178243ea98572c2bac2 Signed-off-by: Christopher R. Hertel Reviewed-on: http://review.gluster.org/6883 Reviewed-by: Shyamsundar Ranganathan Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/features/index/src/index.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'xlators/features') diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c index ec395e8a4..5edfeda8f 100644 --- a/xlators/features/index/src/index.c +++ b/xlators/features/index/src/index.c @@ -371,6 +371,7 @@ sync_base_indices (void *index_priv) char xattrop_directory[PATH_MAX] = {0}; char base_index_path[PATH_MAX] = {0}; char xattrop_index_path[PATH_MAX] = {0}; + int32_t op_errno = 0; int ret = 0; priv = index_priv; @@ -381,11 +382,14 @@ sync_base_indices (void *index_priv) XATTROP_SUBDIR); if ((dir_base_holder = opendir(base_indices_holder)) == NULL) { + op_errno = errno; ret = -1; goto out; } if ((xattrop_dir = opendir (xattrop_directory)) == NULL) { + op_errno = errno; ret = -1; + (void) closedir (dir_base_holder); goto out; } @@ -410,20 +414,30 @@ sync_base_indices (void *index_priv) ret = sys_link (xattrop_index_path, base_index_path); - if (ret && errno != EEXIST) + if (ret && errno != EEXIST) { + op_errno = errno; + (void) closedir (dir_base_holder); + (void) closedir (xattrop_dir); goto out; + } } } ret = closedir (xattrop_dir); - if (ret) + if (ret) { + op_errno = errno; + (void) closedir (dir_base_holder); goto out; + } ret = closedir (dir_base_holder); - if (ret) + if (ret) { + op_errno = errno; goto out; + } ret = 0; out: + errno = op_errno; return ret; } -- cgit From 0ff6a1da6ac4a4b0e01ae50f1d8e3605e36bf2fc Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Thu, 6 Feb 2014 15:22:11 +0530 Subject: features/quota: fix crash in error handling after building ancestry. Change-Id: Ifbebf1aa496d49a6c4bb30258b83aaf9792828e5 BUG: 1059833 Signed-off-by: Raghavendra G Reviewed-on: http://review.gluster.org/6923 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/features/quota/src/quota.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xlators/features') diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index a8b4eb2c3..5224c475b 100644 --- a/xlators/features/quota/src/quota.c +++ b/xlators/features/quota/src/quota.c @@ -721,7 +721,7 @@ quota_check_limit_continuation (struct list_head *parents, inode_t *inode, this = THIS; if ((op_ret < 0) || list_empty (parents)) { - if (list_empty (parents)) { + if (op_ret >= 0) { gf_log (this->name, GF_LOG_WARNING, "Couldn't build ancestry for inode (gfid:%s). " "Without knowing ancestors till root, quota " -- cgit From 66113e3473555c31926045218dc8b79c61751d5d Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Sat, 18 May 2013 11:52:09 +0530 Subject: features/marker-quota: more stringent error handling in rename. If an error occurs and op_errno is not set to non-zero value, we can end up in loosing a frame resulting in a hung syscall. This patch adds code setting op_errno appropriately in storage/posix and makes marker to set err to a default non-zero value in case of op_errno being zero. Change-Id: Idc2c3e843b932709a69b32ba67deb284547168f2 BUG: 833586 Signed-off-by: Raghavendra G Reviewed-on: http://review.gluster.org/5032 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/features/marker/src/marker.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'xlators/features') diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c index d6b6dd358..45058652b 100644 --- a/xlators/features/marker/src/marker.c +++ b/xlators/features/marker/src/marker.c @@ -1021,7 +1021,7 @@ marker_rename_done (call_frame_t *frame, void *cookie, xlator_t *this, if (op_ret < 0) { if (local->err == 0) { - local->err = op_errno; + local->err = op_errno ? op_errno : EINVAL; } gf_log (this->name, GF_LOG_WARNING, @@ -1037,6 +1037,11 @@ marker_rename_done (call_frame_t *frame, void *cookie, xlator_t *this, } else if (local->err != 0) { STACK_UNWIND_STRICT (rename, frame, -1, local->err, NULL, NULL, NULL, NULL, NULL, NULL); + } else { + gf_log (this->name, GF_LOG_CRITICAL, + "continuation stub to unwind the call is absent, hence " + "call will be hung (call-stack id = %"PRIu64")", + frame->root->unique); } mq_reduce_parent_size (this, &oplocal->loc, oplocal->contribution); @@ -1082,7 +1087,7 @@ marker_rename_release_newp_lock (call_frame_t *frame, void *cookie, if (op_ret < 0) { if (local->err == 0) { - local->err = op_errno; + local->err = op_errno ? op_errno : EINVAL; } gf_log (this->name, GF_LOG_WARNING, @@ -1271,7 +1276,7 @@ marker_do_rename (call_frame_t *frame, void *cookie, xlator_t *this, MARKER_RESET_UID_GID (frame, frame->root, local); if ((op_ret < 0) && (op_errno != ENOATTR)) { - local->err = op_errno; + local->err = op_errno ? op_errno : EINVAL; gf_log (this->name, GF_LOG_WARNING, "fetching contribution values from %s (gfid:%s) " "failed (%s)", local->loc.path, @@ -1283,7 +1288,7 @@ marker_do_rename (call_frame_t *frame, void *cookie, xlator_t *this, if (local->loc.inode != NULL) { GET_CONTRI_KEY (contri_key, local->loc.parent->gfid, ret); if (ret < 0) { - local->err = errno; + local->err = errno ? errno : ENOMEM; goto err; } @@ -1323,7 +1328,7 @@ marker_get_newpath_contribution (call_frame_t *frame, void *cookie, MARKER_RESET_UID_GID (frame, frame->root, local); if ((op_ret < 0) && (op_errno != ENOATTR)) { - local->err = op_errno; + local->err = op_errno ? op_errno : EINVAL; gf_log (this->name, GF_LOG_WARNING, "fetching contribution values from %s (gfid:%s) " "failed (%s)", oplocal->loc.path, @@ -1334,7 +1339,7 @@ marker_get_newpath_contribution (call_frame_t *frame, void *cookie, GET_CONTRI_KEY (contri_key, oplocal->loc.parent->gfid, ret); if (ret < 0) { - local->err = errno; + local->err = errno ? errno : ENOMEM; goto err; } @@ -1344,7 +1349,7 @@ marker_get_newpath_contribution (call_frame_t *frame, void *cookie, if (local->loc.inode != NULL) { GET_CONTRI_KEY (contri_key, local->loc.parent->gfid, ret); if (ret < 0) { - local->err = errno; + local->err = errno ? errno : ENOMEM; goto err; } @@ -1385,7 +1390,7 @@ marker_get_oldpath_contribution (call_frame_t *frame, void *cookie, oplocal = local->oplocal; if (op_ret < 0) { - local->err = op_errno; + local->err = op_errno ? op_errno : EINVAL; gf_log (this->name, GF_LOG_WARNING, "cannot hold inodelk on %s (gfid:%s) (%s)", local->next_lock_on->path, @@ -1396,7 +1401,7 @@ marker_get_oldpath_contribution (call_frame_t *frame, void *cookie, GET_CONTRI_KEY (contri_key, oplocal->loc.parent->gfid, ret); if (ret < 0) { - local->err = errno; + local->err = errno ? errno : ENOMEM; goto quota_err; } @@ -1452,7 +1457,7 @@ marker_rename_inodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, loc = &local->parent_loc; } - local->err = op_errno; + local->err = op_errno ? op_errno : EINVAL; gf_log (this->name, GF_LOG_WARNING, "cannot hold inodelk on %s (gfid:%s) (%s)", loc->path, uuid_utoa (loc->inode->gfid), -- cgit From 6b8ed063bb8a551856d0e659fa9fe4f5afa48c19 Mon Sep 17 00:00:00 2001 From: Poornima Date: Tue, 4 Feb 2014 23:11:59 +0000 Subject: features/quota: Fix NULL dereference error reported by coverity. Change-Id: I48c1ebcb3261fa5da721e5b48d17c6c873df256d BUG: 789278 Signed-off-by: Poornima Reviewed-on: http://review.gluster.org/6907 Reviewed-by: Vijay Bellur Tested-by: Gluster Build System --- xlators/features/quota/src/quota.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'xlators/features') diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index 5224c475b..bb5dc7aba 100644 --- a/xlators/features/quota/src/quota.c +++ b/xlators/features/quota/src/quota.c @@ -3387,6 +3387,10 @@ quota_fsetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd, if (hard_lim > 0) { local = quota_local_new (); + if (local == NULL) { + op_errno = ENOMEM; + goto err; + } frame->local = local; local->loc.inode = inode_ref (fd->inode); -- cgit