summaryrefslogtreecommitdiffstats
path: root/xlators/features/bit-rot/src/bitd/bit-rot.c
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendra@redhat.com>2015-05-26 19:22:14 +0530
committerVenky Shankar <vshankar@redhat.com>2015-07-14 21:46:01 -0700
commit5144d3d5a4982a86f46ef023d0dc836d0fdead58 (patch)
treee64663f0f61ecf67443e28cc1eaaef588be57cff /xlators/features/bit-rot/src/bitd/bit-rot.c
parent12987fab053db3893acd5a6cc71ed6a88843756a (diff)
features/bit-rot-stub: deny access to bad objects
Backport of http://review.gluster.org/11126 * Access to bad objects (especially operations such as open, readv, writev) should be denied to prevent applications from getting wrong data. * Do not allow anyone apart from scrubber to set bad object xattr. * Do not allow bad object xattr to be removed. Change-Id: I6903184ab64a9d1ea595330b603935979c33bc26 BUG: 1241529 Reviewed-on: http://review.gluster.org/11603 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Venky Shankar <vshankar@redhat.com>
Diffstat (limited to 'xlators/features/bit-rot/src/bitd/bit-rot.c')
-rw-r--r--xlators/features/bit-rot/src/bitd/bit-rot.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/xlators/features/bit-rot/src/bitd/bit-rot.c b/xlators/features/bit-rot/src/bitd/bit-rot.c
index 7aaafcd2852..6e10e29b5ec 100644
--- a/xlators/features/bit-rot/src/bitd/bit-rot.c
+++ b/xlators/features/bit-rot/src/bitd/bit-rot.c
@@ -164,11 +164,10 @@ bitd_is_bad_file (xlator_t *this, br_child_t *child, loc_t *loc, fd_t *fd)
if (fd)
ret = syncop_fgetxattr (child->xl, fd, &xattr,
- "trusted.glusterfs.bad-file", NULL,
- NULL);
+ BITROT_OBJECT_BAD_KEY, NULL, NULL);
else if (loc)
- ret = syncop_getxattr (child->xl, loc, &xattr,
- "trusted.glusterfs.bad-file", NULL,
+ ret = syncop_getxattr (child->xl, loc,
+ &xattr, BITROT_OBJECT_BAD_KEY, NULL,
NULL);
if (!ret) {