From 6087f73c04797867cf65092174542672b391b21a Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Wed, 13 Jun 2018 12:26:55 +0530 Subject: storage/posix: Fix excessive logging in WRITE fop path Backport of: https://review.gluster.org/#/c/glusterfs/+/20250 I was running some write-intensive tests on my volume, and in a matter of 2 hrs, the 50GB space in my root partition was exhausted. On inspecting further, figured that excessive logging in bricks was the cause - specifically in posix write when posix_check_internal_writes() does dict_get() without a NULL-check on xdata. Change-Id: I89de57a3a90ca5c375e5b9477801a9e5ff018bbf fixes: bz#1596686 Signed-off-by: Krutika Dhananjay (cherry picked from commit 81701e4d92ae7b1d97e5bc955703719f2e9e773a) --- xlators/storage/posix/src/posix-helpers.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'xlators/storage') diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c index c87f4f59b82..f18f181c454 100644 --- a/xlators/storage/posix/src/posix-helpers.c +++ b/xlators/storage/posix/src/posix-helpers.c @@ -2863,6 +2863,9 @@ posix_check_internal_writes (xlator_t *this, fd_t *fd, int sysfd, size_t xattrsize = 0; data_t *val = NULL; + if (!xdata) + return 0; + LOCK (&fd->inode->lock); { val = dict_get (xdata, GF_PROTECT_FROM_EXTERNAL_WRITES); -- cgit