diff options
| author | Raghavendra Talur <rtalur@redhat.com> | 2015-06-25 02:18:42 +0530 | 
|---|---|---|
| committer | Raghavendra G <rgowdapp@redhat.com> | 2015-07-18 10:29:11 -0700 | 
| commit | a00c623dc1aa2df7e374d05f8a2ceaf205e854b6 (patch) | |
| tree | 2c94fdabe0153497f6d3291de65a67bc41d4b8c6 | |
| parent | b2673ae923f3e4651f4c642a9b88f5d200a25585 (diff) | |
storage/posix: Check xdata for NULL before dict_get
Performing a dict_get on xdata can lead to
frequent logging if xdata is NULL.
Change-Id: I1666f0cc958c639ccd816e3738dd4a1efebbff82
BUG: 1235921
Signed-off-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-on: http://review.gluster.org/11390
Reviewed-by: N Balachandran <nbalacha@redhat.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
| -rw-r--r-- | xlators/storage/posix/src/posix.c | 8 | 
1 files changed, 4 insertions, 4 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 8ed24644f5a..1089b7f79fe 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -3317,7 +3317,7 @@ posix_setxattr (call_frame_t *frame, xlator_t *this,   * This is used by DHT to redirect FOPs if the file is being migrated   * Ignore errors for now   */ -        if (dict_get (xdata, DHT_IATT_IN_XDATA_KEY)) { +        if (xdata && dict_get (xdata, DHT_IATT_IN_XDATA_KEY)) {                  ret = posix_pstat(this, loc->gfid, real_path, &stbuf);                  if (ret)                          goto out; @@ -4519,7 +4519,7 @@ posix_fsetxattr (call_frame_t *frame, xlator_t *this,                  }          } -        if (dict_get (xdata, DHT_IATT_IN_XDATA_KEY)) { +        if (xdata && dict_get (xdata, DHT_IATT_IN_XDATA_KEY)) {                  ret = posix_fdstat (this, pfd->fd, &stbuf);                  if (ret == -1) {                          gf_log (this->name, GF_LOG_ERROR, @@ -4660,7 +4660,7 @@ posix_removexattr (call_frame_t *frame, xlator_t *this,                  goto out;          } -        if (dict_get (xdata, DHT_IATT_IN_XDATA_KEY)) { +        if (xdata && dict_get (xdata, DHT_IATT_IN_XDATA_KEY)) {                  ret = posix_pstat(this, loc->gfid, real_path, &stbuf);                  if (ret)                          goto out; @@ -4732,7 +4732,7 @@ posix_fremovexattr (call_frame_t *frame, xlator_t *this,                  goto out;          } -        if (dict_get (xdata, DHT_IATT_IN_XDATA_KEY)) { +        if (xdata && dict_get (xdata, DHT_IATT_IN_XDATA_KEY)) {                  ret = posix_fdstat (this, pfd->fd, &stbuf);                  if (ret)                          goto out;  | 
