diff options
author | Venky Shankar <vshankar@redhat.com> | 2015-03-13 21:23:20 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-03-24 10:55:51 -0700 |
commit | 866c64ba5e29a90b37fa051061a58300ae129a2c (patch) | |
tree | 0cf2ea60032108c9b36a98e06406e971ee817286 /xlators/features/bit-rot/src/bitd/bit-rot.h | |
parent | 7927e8747c731dbb105e93ae66c336338f48f0e6 (diff) |
features/bit-rot: filesystem scrubber
Scrubber performs signature verification for objects that were
signed by signer. This is done by recalculating the signature
(using the hash algorithm the object was signed with) and
verifying it aginst the objects persisted signature. Since the
object could be undergoing IO opretaion at the time of hash
calculation, the signature may not match objects persisted
signature. Bitrot stub provides additional information about
the stalesness of an objects signature (determinted by it's
versioning mechanism). This additional bit of information is
used by scrubber to determine the staleness of the signature,
and in such cases the object is skipped verification (although
signature staleness is performed twice: once before initiation
of hash calculation and another after it (an object could be
modified after staleness checks).
The implmentation is a part of the bitrot xlator (signer) which
acts as a signer or scrubber based on a translator option. As
of now the scrub process is ever running (but has some form of
weak throttling mechanism during filesystem scan). Going forward,
there needs to be some form of scrub scheduling and IO throttling
(during hash calculation) tunables (via CLI).
Change-Id: I665ce90208f6074b98c5a1dd841ce776627cc6f9
BUG: 1170075
Original-Author: Raghavendra Bhat <rabhat@redhat.com>
Original-Author: Venky Shankar <vshankar@redhat.com>
Signed-off-by: Venky Shankar <vshankar@redhat.com>
Reviewed-on: http://review.gluster.org/9914
Tested-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/features/bit-rot/src/bitd/bit-rot.h')
-rw-r--r-- | xlators/features/bit-rot/src/bitd/bit-rot.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/xlators/features/bit-rot/src/bitd/bit-rot.h b/xlators/features/bit-rot/src/bitd/bit-rot.h index ab9fd806232..a634a1fa76f 100644 --- a/xlators/features/bit-rot/src/bitd/bit-rot.h +++ b/xlators/features/bit-rot/src/bitd/bit-rot.h @@ -91,6 +91,8 @@ struct br_private { signing and the workers which sign the objects */ int32_t expiry_time; /* objects "wait" time */ + + gf_boolean_t iamscrubber; /* function as a fs scrubber */ }; typedef struct br_private br_private_t; @@ -118,9 +120,13 @@ void br_log_object_path (xlator_t *, char *, const char *, int32_t); int32_t -br_object_checksum (unsigned char *, br_object_t *, fd_t *, struct iatt *); +br_calculate_obj_checksum (unsigned char *, + br_child_t *, fd_t *, struct iatt *); int32_t br_prepare_loc (xlator_t *, br_child_t *, loc_t *, gf_dirent_t *, loc_t *); +gf_boolean_t +bitd_is_bad_file (xlator_t *, br_child_t *, loc_t *, fd_t *); + #endif /* __BIT_ROT_H__ */ |