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 <kdhananj@redhat.com>
This commit is contained in:
Krutika Dhananjay 2018-06-13 12:26:55 +05:30 committed by jiffin tony Thottan
parent c30aca6a5b
commit 81701e4d92

View File

@ -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);