diff options
author | Venky Shankar <vshankar@redhat.com> | 2015-03-31 15:48:18 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-04-08 07:01:32 +0000 |
commit | f0cd1d73c63001740cd7691a77df7631c9b8e8dc (patch) | |
tree | 336a8ee694dc71a2fde6927d8a40682bef6368ef /xlators/features/bit-rot/src/stub/bit-rot-common.h | |
parent | 7fb55dbdabf73f9169b0f3021a42fa120d64b373 (diff) |
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 <vshankar@redhat.com>
Reviewed-on: http://review.gluster.org/10118
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/features/bit-rot/src/stub/bit-rot-common.h')
-rw-r--r-- | xlators/features/bit-rot/src/stub/bit-rot-common.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/xlators/features/bit-rot/src/stub/bit-rot-common.h b/xlators/features/bit-rot/src/stub/bit-rot-common.h index fdf23142768..699323170d3 100644 --- a/xlators/features/bit-rot/src/stub/bit-rot-common.h +++ b/xlators/features/bit-rot/src/stub/bit-rot-common.h @@ -76,6 +76,7 @@ typedef struct br_isignature_in { unsigned long signedversion; /* version against which the object was signed */ + size_t signaturelen; /* signature length */ char signature[0]; /* object signature */ } br_isignature_t; @@ -86,11 +87,14 @@ typedef struct br_isignature_in { typedef struct br_isignature_out { char stale; /* stale signature? */ + unsigned long version; /* current signed version */ + uint32_t time[2]; /* time when the object got dirtied */ int8_t signaturetype; /* hash type */ - char signature[0]; /* signature (hash) */ + size_t signaturelen; /* signature length */ + char signature[0]; /* signature (hash) */ } br_isignature_out_t; typedef struct br_stub_init { |