From f0cd1d73c63001740cd7691a77df7631c9b8e8dc Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Tue, 31 Mar 2015 15:48:18 +0530 Subject: bitrot/scrub: Scrubber fixes This patch fixes a handful of problem with scrubber which are detailed below. Scrubber used to skip objects for verification due to missing fd iterface to fetch versioning extended attributes. Similar to the inode interface, an fd based interface in POSIX is now introduced. Moreover, this patch also fixes potential false reporting by scrubber due to: An object gets dirtied and signed when scrubber is busy calculatingobject checksum. This is fixed by caching the signed version when an object is first inspected for stalenes, i.e., during pre-compute stage. This version is used to verify checksum in the post-compute stage when the signatures are compared for possible corruption. Side effect of _not_ sending signature length during signing resulted in "truncated" signature to be set for an object. Now, at the time of signing, the signature length is sent and is used in place of invoking strlen() to get signature length (which could have possible 00s). The signature length itself is not persisted in the signature xattr, but is calculated on-the-fly by substracting the xattr length by the "structure" header size. Some of the log entries are made more meaningful (as and aid for debugging). Change-Id: I938bee5aea6688d5d99eb2640053613af86d6269 BUG: 1207624 Signed-off-by: Venky Shankar Reviewed-on: http://review.gluster.org/10118 Reviewed-by: Raghavendra Bhat Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- libglusterfs/src/glusterfs.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libglusterfs') diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h index c5459018717..50a5dba86ee 100644 --- a/libglusterfs/src/glusterfs.h +++ b/libglusterfs/src/glusterfs.h @@ -124,6 +124,9 @@ #define BITROT_CURRENT_VERSION_KEY "trusted.glusterfs.bit-rot.version" #define BITROT_SIGNING_VERSION_KEY "trusted.glusterfs.bit-rot.signature" +/* on-disk size of signing xattr (not the signature itself) */ +#define BITROT_SIGNING_XATTR_SIZE_KEY "trusted.glusterfs.bit-rot.size" + /* GET/SET object signature */ #define GLUSTERFS_GET_OBJECT_SIGNATURE "trusted.glusterfs.get-signature" #define GLUSTERFS_SET_OBJECT_SIGNATURE "trusted.glusterfs.set-signature" -- cgit