From 517316470e8e309e0e572264ee3c02b0748acab1 Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Tue, 8 Aug 2017 21:42:03 +0530 Subject: posix: add null gfid checks (Backport of https://review.gluster.org/17975) ...in file/dir creation and lookup codepaths. The check is relaxed for fops coming from trash xlator at the moment until trash has client side logic to send the create fops with gfid-req. Also fixed the missing trash pid assignment in creates sent by trash xlator. Without this, truncated files won't be moved to .trashcan. Change-Id: Ieddd7f0634850e7c7010e4fbb4ad1eead35888c8 BUG: 1479474 Signed-off-by: Ravishankar N Reviewed-on: https://review.gluster.org/17996 Smoke: Gluster Build System CentOS-regression: Gluster Build System Reviewed-by: Shyamsundar Ranganathan --- xlators/storage/posix/src/posix.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'xlators/storage/posix/src/posix.c') diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 4e4076701a2..72c65a18c5f 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -1347,6 +1347,8 @@ posix_mknod (call_frame_t *frame, xlator_t *this, priv = this->private; VALIDATE_OR_GOTO (priv, out); + GFID_NULL_CHECK_AND_GOTO (frame, this, loc, xdata, op_ret, op_errno, + out); MAKE_ENTRY_HANDLE (real_path, par_path, this, loc, NULL); @@ -1565,6 +1567,8 @@ posix_mkdir (call_frame_t *frame, xlator_t *this, priv = this->private; VALIDATE_OR_GOTO (priv, out); + GFID_NULL_CHECK_AND_GOTO (frame, this, loc, xdata, op_ret, op_errno, + out); MAKE_ENTRY_HANDLE (real_path, par_path, this, loc, NULL); if (!real_path || !par_path) { @@ -2389,6 +2393,8 @@ posix_symlink (call_frame_t *frame, xlator_t *this, priv = this->private; VALIDATE_OR_GOTO (priv, out); + GFID_NULL_CHECK_AND_GOTO (frame, this, loc, xdata, op_ret, op_errno, + out); MAKE_ENTRY_HANDLE (real_path, par_path, this, loc, &stbuf); @@ -3036,6 +3042,8 @@ posix_create (call_frame_t *frame, xlator_t *this, priv = this->private; VALIDATE_OR_GOTO (priv, out); + GFID_NULL_CHECK_AND_GOTO (frame, this, loc, xdata, op_ret, op_errno, + out); MAKE_ENTRY_HANDLE (real_path, par_path, this, loc, &stbuf); -- cgit