From 81701e4d92ae7b1d97e5bc955703719f2e9e773a 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 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#1590655 Signed-off-by: Krutika Dhananjay --- xlators/storage/posix/src/posix-helpers.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'xlators/storage/posix/src/posix-helpers.c') diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c index 00118b2d123..236f2e61c33 100644 --- a/xlators/storage/posix/src/posix-helpers.c +++ b/xlators/storage/posix/src/posix-helpers.c @@ -2870,6 +2870,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