[era_invalidate] Don't open in exclusive mode if using a metadata snap.

Patch from bobk-rey on github
This commit is contained in:
Joe Thornber 2015-09-08 10:12:56 +01:00
parent 29c2a949f4
commit 78b24dee19
2 changed files with 2 additions and 2 deletions

View File

@ -152,7 +152,7 @@ namespace {
int invalidate(string const &dev, string const &output, flags const &fs) { int invalidate(string const &dev, string const &output, flags const &fs) {
try { try {
set<uint32_t> blocks; set<uint32_t> blocks;
block_manager<>::ptr bm = open_bm(dev, block_manager<>::READ_ONLY); block_manager<>::ptr bm = open_bm(dev, block_manager<>::READ_ONLY, !fs.metadata_snapshot_);
if (fs.metadata_snapshot_) { if (fs.metadata_snapshot_) {
superblock sb = read_superblock(bm); superblock sb = read_superblock(bm);

View File

@ -11,7 +11,7 @@ era_invalidate \- Provide a list of blocks that have changed since a particular
.B era_invalidate .B era_invalidate
Examines era metadata and lists blocks that may have changed since a given era. Examines era metadata and lists blocks that may have changed since a given era.
This tool cannot be run on live metadata. This tool cannot be run on live metadata unless the \fB\-\-metadata\-snap\fP option is used.
.SH OPTIONS .SH OPTIONS
.IP "\fB\-h, \-\-help\fP" .IP "\fB\-h, \-\-help\fP"