Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 311988 Details for
Bug 404611
GFS2: gfs2_fsck dupl. blocks between EA and data
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Third prototype patch
404611.prototype3.patch (text/plain), 25.62 KB, created by
Robert Peterson
on 2008-07-16 20:07:10 UTC
(
hide
)
Description:
Third prototype patch
Filename:
MIME Type:
Creator:
Robert Peterson
Created:
2008-07-16 20:07:10 UTC
Size:
25.62 KB
patch
obsolete
> gfs2/fsck/metawalk.c | 103 ++++++++++++----- > gfs2/fsck/metawalk.h | 2 + > gfs2/fsck/pass1.c | 312 ++++++++++++++++++++++++++++++++++---------------- > gfs2/fsck/pass1c.c | 28 +++-- > 4 files changed, 305 insertions(+), 140 deletions(-) > >diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c >index ac7e8f0..e3804de 100644 >--- a/gfs2/fsck/metawalk.c >+++ b/gfs2/fsck/metawalk.c >@@ -456,8 +456,9 @@ int check_leaf(struct gfs2_inode *ip, int *update, struct metawalk_fxns *pass) > } > > static int check_eattr_entries(struct gfs2_inode *ip, >- struct gfs2_buffer_head *bh, >- struct metawalk_fxns *pass) >+ struct gfs2_buffer_head *bh, >+ struct metawalk_fxns *pass, >+ int *update_it) > { > struct gfs2_ea_header *ea_hdr, *ea_hdr_prev = NULL; > uint64_t *ea_data_ptr = NULL; >@@ -465,6 +466,7 @@ static int check_eattr_entries(struct gfs2_inode *ip, > int error = 0; > uint32_t offset = (uint32_t)sizeof(struct gfs2_meta_header); > >+ *update_it = 0; > if(!pass->check_eattr_entry) { > return 0; > } >@@ -479,29 +481,45 @@ static int check_eattr_entries(struct gfs2_inode *ip, > stack; > return -1; > } >- if(error == 0) { >- if(pass->check_eattr_extentry && ea_hdr->ea_num_ptrs) { >- ea_data_ptr = ((uint64_t *)((char *)ea_hdr + >- sizeof(struct gfs2_ea_header) + >- ((ea_hdr->ea_name_len + 7) & ~7))); >- >- /* It is possible when a EA is shrunk >- ** to have ea_num_ptrs be greater than >- ** the number required for ** data. >- ** In this case, the EA ** code leaves >- ** the blocks ** there for ** >- ** reuse........... */ >- for(i = 0; i < ea_hdr->ea_num_ptrs; i++){ >- if(pass->check_eattr_extentry(ip, >- ea_data_ptr, >- bh, ea_hdr, >- ea_hdr_prev, >- pass->private)) { >- stack; >+ if(error == 0 && pass->check_eattr_extentry && >+ ea_hdr->ea_num_ptrs) { >+ uint32_t tot_ealen = 0; >+ struct gfs2_sbd *sdp = ip->i_sbd; >+ >+ ea_data_ptr = ((uint64_t *)((char *)ea_hdr + >+ sizeof(struct gfs2_ea_header) + >+ ((ea_hdr->ea_name_len + 7) & ~7))); >+ >+ /* It is possible when a EA is shrunk >+ ** to have ea_num_ptrs be greater than >+ ** the number required for ** data. >+ ** In this case, the EA ** code leaves >+ ** the blocks ** there for ** >+ ** reuse........... */ >+ >+ for(i = 0; i < ea_hdr->ea_num_ptrs; i++){ >+ if(pass->check_eattr_extentry(ip, >+ ea_data_ptr, >+ bh, ea_hdr, >+ ea_hdr_prev, >+ pass->private)) { >+ if (query(&opts, "Repair the bad EA? " >+ "(y/n) ")) { >+ ea_hdr->ea_num_ptrs = i; >+ ea_hdr->ea_data_len = >+ cpu_to_be32(tot_ealen); >+ *ea_data_ptr = 0; >+ *update_it = 1; >+ /* Endianness doesn't matter >+ in this case because it's >+ a single byte. */ > return -1; > } >- ea_data_ptr++; >+ log_err("The bad EA was not fixed.\n"); > } >+ tot_ealen += sdp->sd_sb.sb_bsize - >+ sizeof(struct gfs2_meta_header); >+ ea_data_ptr++; > } > } > offset += be32_to_cpu(ea_hdr->ea_rec_len); >@@ -530,6 +548,8 @@ static int check_leaf_eattr(struct gfs2_inode *ip, uint64_t block, > { > struct gfs2_buffer_head *bh = NULL; > int error = 0; >+ int update; >+ > log_debug("Checking EA leaf block #%"PRIu64" (0x%" PRIx64 ").\n", > block, block); > >@@ -542,9 +562,9 @@ static int check_leaf_eattr(struct gfs2_inode *ip, uint64_t block, > if(error > 0) { > return 1; > } >- check_eattr_entries(ip, bh, pass); >+ check_eattr_entries(ip, bh, pass, &update); > if (bh) >- brelse(bh, not_updated); >+ brelse(bh, update); > } > > return 0; >@@ -568,9 +588,13 @@ static int check_indirect_eattr(struct gfs2_inode *ip, uint64_t indirect, > log_debug("Checking EA indirect block #%"PRIu64" (0x%" PRIx64 ").\n", > indirect, indirect); > >- if (pass->check_eattr_indir && >- !pass->check_eattr_indir(ip, indirect, ip->i_di.di_num.no_addr, >- &indirect_buf, pass->private)) { >+ if (!pass->check_eattr_indir) >+ return 0; >+ error = pass->check_eattr_indir(ip, indirect, ip->i_di.di_num.no_addr, >+ &indirect_buf, pass->private); >+ if (!error) { >+ int leaf_pointers = 0, leaf_pointer_errors = 0; >+ > ea_leaf_ptr = (uint64_t *)(indirect_buf->b_data > + sizeof(struct gfs2_meta_header)); > end = ea_leaf_ptr + ((sdp->sd_sb.sb_bsize >@@ -578,13 +602,29 @@ static int check_indirect_eattr(struct gfs2_inode *ip, uint64_t indirect, > > while(*ea_leaf_ptr && (ea_leaf_ptr < end)){ > block = be64_to_cpu(*ea_leaf_ptr); >- /* FIXME: should I call check_leaf_eattr if we >- * find a dup? */ >+ leaf_pointers++; > error = check_leaf_eattr(ip, block, indirect, pass); >+ if (error) >+ leaf_pointer_errors++; > ea_leaf_ptr++; > } >- brelse(indirect_buf, not_updated); >+ if (pass->finish_eattr_indir) { >+ int indir_ok = 1; >+ >+ if (leaf_pointer_errors == leaf_pointers) >+ indir_ok = 0; >+ pass->finish_eattr_indir(ip, indir_ok, pass->private); >+ if (!indir_ok) { >+ gfs2_set_bitmap(sdp, indirect, >+ GFS2_BLKST_FREE); >+ gfs2_block_clear(bl, indirect, gfs2_indir_blk); >+ gfs2_block_set(bl, indirect, gfs2_block_free); >+ error = 1; >+ } >+ } > } >+ if (indirect_buf) >+ brelse(indirect_buf, not_updated); > > return error; > } >@@ -604,8 +644,7 @@ int check_inode_eattr(struct gfs2_inode *ip, struct metawalk_fxns *pass) > } > > log_debug("Extended attributes exist for inode #%" PRIu64 " (0x%" PRIx64 >- ").\n", ip->i_di.di_num.no_formal_ino, >- ip->i_di.di_num.no_formal_ino); >+ ").\n", ip->i_di.di_num.no_addr, ip->i_di.di_num.no_addr); > > if(ip->i_di.di_flags & GFS2_DIF_EA_INDIRECT){ > if((error = check_indirect_eattr(ip, ip->i_di.di_eattr, pass))) >diff --git a/gfs2/fsck/metawalk.h b/gfs2/fsck/metawalk.h >index 2b0f847..3906493 100644 >--- a/gfs2/fsck/metawalk.h >+++ b/gfs2/fsck/metawalk.h >@@ -73,6 +73,8 @@ struct metawalk_fxns { > struct gfs2_ea_header *ea_hdr, > struct gfs2_ea_header *ea_hdr_prev, > void *private); >+ int (*finish_eattr_indir) (struct gfs2_inode *ip, int indir_ok, >+ void *private); > }; > > #endif /* _METAWALK_H */ >diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c >index b00331d..c802158 100644 >--- a/gfs2/fsck/pass1.c >+++ b/gfs2/fsck/pass1.c >@@ -44,7 +44,44 @@ struct block_count { > }; > > static int leaf(struct gfs2_inode *ip, uint64_t block, >- struct gfs2_buffer_head *bh, void *private) >+ struct gfs2_buffer_head *bh, void *private); >+static int check_metalist(struct gfs2_inode *ip, uint64_t block, >+ struct gfs2_buffer_head **bh, void *private); >+static int check_data(struct gfs2_inode *ip, uint64_t block, void *private); >+static int check_eattr_indir(struct gfs2_inode *ip, uint64_t indirect, >+ uint64_t parent, struct gfs2_buffer_head **bh, >+ void *private); >+static int check_eattr_leaf(struct gfs2_inode *ip, uint64_t block, >+ uint64_t parent, struct gfs2_buffer_head **bh, >+ void *private); >+static int check_eattr_entries(struct gfs2_inode *ip, >+ struct gfs2_buffer_head *leaf_bh, >+ struct gfs2_ea_header *ea_hdr, >+ struct gfs2_ea_header *ea_hdr_prev, >+ void *private); >+static int check_extended_leaf_eattr(struct gfs2_inode *ip, uint64_t *data_ptr, >+ struct gfs2_buffer_head *leaf_bh, >+ struct gfs2_ea_header *ea_hdr, >+ struct gfs2_ea_header *ea_hdr_prev, >+ void *private); >+static int finish_eattr_indir(struct gfs2_inode *ip, int indir_ok, >+ void *private); >+ >+struct metawalk_fxns pass1_fxns = { >+ .private = NULL, >+ .check_leaf = leaf, >+ .check_metalist = check_metalist, >+ .check_data = check_data, >+ .check_eattr_indir = check_eattr_indir, >+ .check_eattr_leaf = check_eattr_leaf, >+ .check_dentry = NULL, >+ .check_eattr_entry = check_eattr_entries, >+ .check_eattr_extentry = check_extended_leaf_eattr, >+ .finish_eattr_indir = finish_eattr_indir, >+}; >+ >+static int leaf(struct gfs2_inode *ip, uint64_t block, >+ struct gfs2_buffer_head *bh, void *private) > { > struct block_count *bc = (struct block_count *) private; > >@@ -56,7 +93,7 @@ static int leaf(struct gfs2_inode *ip, uint64_t block, > } > > static int check_metalist(struct gfs2_inode *ip, uint64_t block, >- struct gfs2_buffer_head **bh, void *private) >+ struct gfs2_buffer_head **bh, void *private) > { > struct gfs2_block_query q = {0}; > int found_dup = 0; >@@ -132,9 +169,52 @@ static int check_data(struct gfs2_inode *ip, uint64_t block, void *private) > return 0; > } > >+/* clear_eas - clear the extended attributes for an inode >+ * >+ * @ip - in core inode pointer >+ * @bc - pointer to a block count structure >+ * block - the block that had the problem >+ * duplicate - if this is a duplicate block, don't set it "free" >+ * emsg - what to tell the user about the eas being checked >+ * Returns: 1 if the EA is fixed, else 0 if it was not fixed. >+ */ >+static int clear_eas(struct gfs2_inode *ip, struct block_count *bc, >+ uint64_t block, int duplicate, const char *emsg) >+{ >+ struct gfs2_sbd *sdp = ip->i_sbd; >+ >+ log_err("Inode #%" PRIu64 " (0x%" PRIx64 "): %s", >+ ip->i_di.di_num.no_addr, ip->i_di.di_num.no_addr, emsg); >+ if (block) >+ log_err(" at block #%" PRIu64 " (0x%" PRIx64 ")", >+ block, block); >+ log_err(".\n"); >+ if (query(&opts, "Clear the bad EA? (y/n) ")) { >+ if (block == 0) >+ block = ip->i_di.di_eattr; >+ gfs2_block_clear(bl, block, gfs2_eattr_block); >+ if (!duplicate) { >+ gfs2_block_clear(bl, block, gfs2_indir_blk); >+ gfs2_block_set(bl, block, gfs2_block_free); >+ gfs2_set_bitmap(sdp, block, GFS2_BLKST_FREE); >+ } >+ ip->i_di.di_flags &= ~GFS2_DIF_EA_INDIRECT; >+ if (block == ip->i_di.di_eattr) >+ ip->i_di.di_eattr = 0; >+ bc->ea_count = 0; >+ ip->i_di.di_blocks = 1 + bc->indir_count + bc->data_count; >+ gfs2_dinode_out(&ip->i_di, ip->i_bh->b_data); >+ return 1; >+ } else { >+ log_err("The bad EA was not fixed.\n"); >+ bc->ea_count++; >+ return 0; >+ } >+} >+ > static int check_eattr_indir(struct gfs2_inode *ip, uint64_t indirect, >- uint64_t parent, struct gfs2_buffer_head **bh, >- void *private) >+ uint64_t parent, struct gfs2_buffer_head **bh, >+ void *private) > { > struct gfs2_sbd *sdp = ip->i_sbd; > int ret = 0; >@@ -149,45 +229,62 @@ static int check_eattr_indir(struct gfs2_inode *ip, uint64_t indirect, > gfs2_block_set(bl, parent, bad_block);*/ > /* Doesn't help to mark this here - this gets checked > * in pass1c */ >- ret = 1; >+ return 1; > } >- else if(gfs2_block_check(bl, indirect, &q)) { >+ if(gfs2_block_check(bl, indirect, &q)) { > stack; >- ret = -1; >+ return -1; > } >- else if(q.block_type != gfs2_block_free) { >- log_debug("Duplicate block found at #%" PRIu64 " (0x%" PRIx64 ").\n", >- indirect, indirect); >+ >+ /* Special duplicate processing: If we have an EA block, >+ check if it really is an EA. If it is, let duplicate >+ handling sort it out. If it isn't, clear it but don't >+ count it as a duplicate. */ >+ *bh = bread(sdp, indirect); >+ if(gfs2_check_meta(*bh, GFS2_METATYPE_IN)) { >+ if(q.block_type != gfs2_block_free) { /* Duplicate? */ >+ if (!clear_eas(ip, bc, indirect, 1, >+ "Bad indirect EA duplicate found")) >+ gfs2_block_set(bl, indirect, gfs2_dup_block); >+ return 1; >+ } >+ clear_eas(ip, bc, indirect, 0, >+ "EA indirect block has incorrect type"); >+ return 1; >+ } >+ if(q.block_type != gfs2_block_free) { /* Duplicate? */ >+ log_err("Inode #%" PRIu64 " (0x%" PRIx64 >+ "): Duplicate EA indirect block found at #%" PRIu64 >+ " (0x%" PRIx64 ").\n", >+ ip->i_di.di_num.no_addr, ip->i_di.di_num.no_addr, >+ indirect, indirect); > gfs2_block_set(bl, indirect, gfs2_dup_block); > bc->ea_count++; > ret = 1; >+ } else { >+ log_debug("Setting #%" PRIu64 " (0x%" PRIx64 >+ ") to indirect EA block\n", indirect, indirect); >+ gfs2_block_set(bl, indirect, gfs2_indir_blk); >+ bc->ea_count++; > } >- else { >- log_debug("Marking inode %" PRIu64 " (0x%" >+ return ret; >+} >+ >+static int finish_eattr_indir(struct gfs2_inode *ip, int indir_ok, >+ void *private) >+{ >+ if (indir_ok) { >+ log_debug("Marking inode #%" PRIu64 " (0x%" > PRIx64 ") with eattr block\n", > ip->i_di.di_num.no_addr, ip->i_di.di_num.no_addr); > /* Mark the inode as having an eattr in the block map > so pass1c can check it. */ > gfs2_block_mark(bl, ip->i_di.di_num.no_addr, gfs2_eattr_block); >- >- *bh = bread(sdp, indirect); >- if(gfs2_check_meta(*bh, GFS2_METATYPE_IN)) { >- log_warn("EA indirect block %" PRIu64 " (0x%" PRIx64 >- ") has incorrect type.\n", >- indirect, indirect); >- gfs2_block_set(bl, indirect, gfs2_meta_inval); >- ret = 1; >- brelse(*bh, not_updated); >- } >- else { >- /* FIXME: do i need to differentiate this as an ea_indir? */ >- log_debug("Setting %" PRIu64 " (0x%" PRIx64 >- ") to indirect block\n", indirect, indirect); >- gfs2_block_set(bl, indirect, gfs2_indir_blk); >- bc->ea_count++; >- } >+ return 0; > } >- return ret; >+ clear_eas(ip, (struct block_count *)private, 0, 0, >+ "has unrecoverable indirect EA errors"); >+ return 0; > } > > /** >@@ -212,10 +309,14 @@ static int check_extended_leaf_eattr(struct gfs2_inode *ip, uint64_t *data_ptr, > struct gfs2_block_query q; > uint64_t el_blk = be64_to_cpu(*data_ptr); > struct block_count *bc = (struct block_count *) private; >+ int ret = 0; > > if(gfs2_check_range(sdp, el_blk)){ >- log_err("EA extended leaf block #%" PRIu64 " (0x%" PRIx64 >- ") is out of range.\n", el_blk, el_blk); >+ log_err("Inode #%" PRIu64 " (0x%" PRIx64 "): EA extended " >+ "leaf block #%" PRIu64 " (0x%" PRIx64 >+ ") is out of range.\n", >+ ip->i_di.di_num.no_addr, ip->i_di.di_num.no_addr, >+ el_blk, el_blk); > gfs2_block_set(bl, ip->i_di.di_eattr, gfs2_bad_block); > return 1; > } >@@ -224,28 +325,39 @@ static int check_extended_leaf_eattr(struct gfs2_inode *ip, uint64_t *data_ptr, > stack; > return -1; > } >- if(q.block_type != gfs2_block_free) { >- gfs2_block_set(bl, el_blk, gfs2_dup_block); >- bc->ea_count++; >- return 1; >- } >- > el_buf = bread(sdp, el_blk); > >+ /* Special duplicate processing: If we have an EA block, >+ check if it really is an EA. If it is, let duplicate >+ handling sort it out. If it isn't, clear it but don't >+ count it as a duplicate. */ > if(gfs2_check_meta(el_buf, GFS2_METATYPE_ED)) { >- log_err("EA extended leaf block %" PRIu64 " (0x%" PRIx64 >- ") has incorrect type.\n", el_blk, el_blk); >- brelse(el_buf, not_updated); >- gfs2_block_set(bl, el_blk, gfs2_meta_inval); >- return 1; >+ if(q.block_type != gfs2_block_free) /* Duplicate? */ >+ clear_eas(ip, bc, el_blk, 1, >+ "has bad extended EA duplicate"); >+ else >+ clear_eas(ip, bc, el_blk, 0, >+ "EA extended leaf block has incorrect type"); >+ ret = 1; >+ } else { /* If this looks like an EA */ >+ if(q.block_type != gfs2_block_free) { /* Duplicate? */ >+ log_debug("Duplicate block found at #%" PRIu64 >+ " (0x%" PRIx64 ").\n", >+ el_blk, el_blk); >+ gfs2_block_set(bl, el_blk, gfs2_dup_block); >+ bc->ea_count++; >+ ret = 1; >+ } else { >+ log_debug("Setting block #%" PRIu64 >+ " (0x%" PRIx64 ") to eattr block\n", >+ el_blk, el_blk); >+ gfs2_block_set(bl, el_blk, gfs2_meta_eattr); >+ bc->ea_count++; >+ } > } > >- log_debug("Setting %" PRIu64 " (0x%" PRIx64 ") to eattr block\n", >- el_blk, el_blk); >- gfs2_block_set(bl, el_blk, gfs2_meta_eattr); >- bc->ea_count++; > brelse(el_buf, not_updated); >- return 0; >+ return ret; > } > > static int check_eattr_leaf(struct gfs2_inode *ip, uint64_t block, >@@ -266,10 +378,10 @@ static int check_eattr_leaf(struct gfs2_inode *ip, uint64_t block, > gfs2_block_set(bl, parent, gfs2_eattr_block); > } > if(gfs2_check_range(sdp, block)){ >- log_warn("EA leaf block #%" PRIu64 " (0x%" PRIx64 ") in inode %" PRIu64 >- " (0x%" PRIx64 ") is out of range.\n", >- ip->i_di.di_num.no_addr, ip->i_di.di_num.no_addr, >- block, block); >+ log_warn("Inode #%" PRIu64 " (0x%" PRIx64 "): EA leaf block " >+ "#%" PRIu64 " (0x%" PRIx64 ") is out of range.\n", >+ ip->i_di.di_num.no_addr, ip->i_di.di_num.no_addr, >+ block, block); > gfs2_block_set(bl, ip->i_di.di_eattr, gfs2_bad_block); > ret = 1; > } >@@ -277,33 +389,42 @@ static int check_eattr_leaf(struct gfs2_inode *ip, uint64_t block, > stack; > return -1; > } >- else if(q.block_type != gfs2_block_free) { >- log_debug("Duplicate block found at #%" PRIu64 " (0x%" PRIx64 ").\n", >- block, block); >- gfs2_block_set(bl, block, gfs2_dup_block); >- bc->ea_count++; >- ret = 1; >- } > else { >+ /* Special duplicate processing: If we have an EA block, >+ check if it really is an EA. If it is, let duplicate >+ handling sort it out. If it isn't, clear it but don't >+ count it as a duplicate. */ > leaf_bh = bread(sdp, block); > if(gfs2_check_meta(leaf_bh, GFS2_METATYPE_EA)) { >- log_warn("EA leaf block %"PRIu64" (0x%" >- PRIx64") for inode %"PRIu64" (0x%" >- PRIx64") has incorrect type.\n", >- block, block, ip->i_di.di_num.no_addr, >- ip->i_di.di_num.no_addr); >- gfs2_block_set(bl, block, gfs2_meta_inval); >- ret = -1; >+ if(q.block_type != gfs2_block_free) { /* Duplicate? */ >+ clear_eas(ip, bc, block, 1, >+ "Bad EA duplicate found"); >+ } else { >+ clear_eas(ip, bc, block, 0, >+ "EA leaf block has incorrect type"); >+ } >+ ret = 1; > brelse(leaf_bh, not_updated); >- } >- else { >- log_debug("Setting block %" PRIu64 " (0x%" PRIx64 >- ") to eattr block\n", block, block); >- gfs2_block_set(bl, block, gfs2_meta_eattr); >- bc->ea_count++; >+ } else { /* If this looks like an EA */ >+ if(q.block_type != gfs2_block_free) { /* Duplicate? */ >+ log_debug("Duplicate block found at #%" PRIu64 >+ " (0x%" PRIx64 ").\n", >+ block, block); >+ gfs2_block_set(bl, block, gfs2_dup_block); >+ bc->ea_count++; >+ ret = 1; >+ brelse(leaf_bh, not_updated); >+ } else { >+ log_debug("Setting block #%" PRIu64 >+ " (0x%" PRIx64 ") to eattr block\n", >+ block, block); >+ gfs2_block_set(bl, block, gfs2_meta_eattr); >+ bc->ea_count++; >+ } > } > } >- *bh = leaf_bh; >+ if (!ret) >+ *bh = leaf_bh; > > return ret; > } >@@ -349,18 +470,6 @@ static int check_eattr_entries(struct gfs2_inode *ip, > return 0; > } > >-struct metawalk_fxns pass1_fxns = { >- .private = NULL, >- .check_leaf = leaf, >- .check_metalist = check_metalist, >- .check_data = check_data, >- .check_eattr_indir = check_eattr_indir, >- .check_eattr_leaf = check_eattr_leaf, >- .check_dentry = NULL, >- .check_eattr_entry = check_eattr_entries, >- .check_eattr_extentry = check_extended_leaf_eattr, >-}; >- > int clear_metalist(struct gfs2_inode *ip, uint64_t block, > struct gfs2_buffer_head **bh, void *private) > { >@@ -399,14 +508,14 @@ int clear_leaf(struct gfs2_inode *ip, uint64_t block, > struct gfs2_buffer_head *bh, void *private) > { > struct gfs2_block_query q = {0}; >- log_crit("Clearing leaf %" PRIu64 " (0x%" PRIx64 ")\n", block, block); >+ log_crit("Clearing leaf #%" PRIu64 " (0x%" PRIx64 ")\n", block, block); > > if(gfs2_block_check(bl, block, &q)) { > stack; > return -1; > } > if(!q.dup_block) { >- log_crit("Setting leaf %" PRIu64 " (0x%" PRIx64 ") invalid\n", >+ log_crit("Setting leaf #%" PRIu64 " (0x%" PRIx64 ") invalid\n", > block, block); > if(gfs2_block_set(bl, block, gfs2_block_free)) { > stack; >@@ -429,7 +538,7 @@ int add_to_dir_list(struct gfs2_sbd *sbp, uint64_t block) > * matter too much */ > find_di(sbp, block, &di); > if(di) { >- log_err("Attempting to add directory block %" PRIu64 >+ log_err("Attempting to add directory block #%" PRIu64 > " (0x%" PRIx64 ") which is already in list\n", block, block); > return -1; > } >@@ -469,13 +578,13 @@ int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh, > "): Bad inode address found: %" PRIu64 " (0x%" PRIx64 ")\n", > block, block, ip->i_di.di_num.no_addr, > ip->i_di.di_num.no_addr); >- if(query(&opts, "Fix address in inode at block %" >+ if(query(&opts, "Fix address in inode at block #%" > PRIu64 " (0x%" PRIx64 ")? (y/n) ", block, block)) { > ip->i_di.di_num.no_addr = ip->i_di.di_num.no_formal_ino = block; > gfs2_dinode_out(&ip->i_di, ip->i_bh->b_data); > f = updated; > } else >- log_err("Address in inode at block %" PRIu64 >+ log_err("Address in inode at block #%" PRIu64 > " (0x%" PRIx64 ") not fixed\n", block, block); > } > >@@ -485,7 +594,7 @@ int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh, > return -1; > } > if(q.block_type != gfs2_block_free) { >- log_debug("Found duplicate block at %" PRIu64 " (0x%" PRIx64 ")\n", >+ log_debug("Found duplicate block at #%" PRIu64 " (0x%" PRIx64 ")\n", > block, block); > if(gfs2_block_mark(bl, block, gfs2_dup_block)) { > stack; >@@ -574,6 +683,7 @@ int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh, > fsck_inode_put(ip, f); > return -1; > } >+ gfs2_set_bitmap(sdp, block, GFS2_BLKST_FREE); > fsck_inode_put(ip, f); > return 0; > } >@@ -597,6 +707,7 @@ int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh, > fsck_inode_put(ip, f); > return -1; > } >+ gfs2_set_bitmap(sdp, block, GFS2_BLKST_FREE); > fsck_inode_put(ip, f); > return 0; > } >@@ -616,6 +727,7 @@ int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh, > fsck_inode_put(ip, f); > return -1; > } >+ gfs2_set_bitmap(sdp, block, GFS2_BLKST_FREE); > fsck_inode_put(ip, f); > return 0; > } >@@ -629,23 +741,22 @@ int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh, > return 0; > } > if(error > 0) { >- log_warn("Marking inode invalid\n"); >+ log_warn("Marking inode #%" PRIu64 " (0x%" PRIx64 ") invalid\n", >+ ip->i_di.di_num.no_addr, ip->i_di.di_num.no_addr); > /* FIXME: Must set all leaves invalid as well */ > check_metatree(ip, &invalidate_metatree); > gfs2_block_set(bl, ip->i_di.di_num.no_addr, gfs2_meta_inval); >+ gfs2_set_bitmap(sdp, ip->i_di.di_num.no_addr, GFS2_BLKST_FREE); > fsck_inode_put(ip, f); > return 0; > } > >- if(check_inode_eattr(ip, &pass1_fxns) < 0){ >- ip->i_di.di_eattr = 0; >- gfs2_dinode_out(&ip->i_di, ip->i_bh->b_data); >+ if(check_inode_eattr(ip, &pass1_fxns) != 0) > f = updated; >- } > > if (ip->i_di.di_blocks != > (1 + bc.indir_count + bc.data_count + bc.ea_count)) { >- log_err("Inode %" PRIu64 " (0x%" PRIx64 "): Ondisk block count (%" >+ log_err("Inode #%" PRIu64 " (0x%" PRIx64 "): Ondisk block count (%" > PRIu64 ") does not match what fsck found (%" PRIu64 ")\n", > ip->i_di.di_num.no_addr, ip->i_di.di_num.no_addr, > ip->i_di.di_blocks, >@@ -656,7 +767,7 @@ int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh, > gfs2_dinode_out(&ip->i_di, ip->i_bh->b_data); > f = updated; > } else >- log_err("Bad block count for %" PRIu64 " (0x%" PRIx64 >+ log_err("Bad block count for #%" PRIu64 " (0x%" PRIx64 > ") not fixed\n", ip->i_di.di_num.no_addr, > ip->i_di.di_num.no_addr); > } >@@ -669,16 +780,17 @@ int scan_meta(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh, > uint64_t block) > { > if (gfs2_check_meta(bh, 0)) { >- log_debug("Found invalid metadata at %" PRIu64 " (0x%" PRIx64 ")\n", >+ log_debug("Found invalid metadata at #%" PRIu64 " (0x%" PRIx64 ")\n", > block, block); > if(gfs2_block_set(bl, block, gfs2_meta_inval)) { > stack; > return -1; > } >+ gfs2_set_bitmap(sdp, block, GFS2_BLKST_FREE); > return 0; > } > >- log_debug("Checking metadata block %" PRIu64 " (0x%" PRIx64 ")\n", block, >+ log_debug("Checking metadata block #%" PRIu64 " (0x%" PRIx64 ")\n", block, > block); > > if (!gfs2_check_meta(bh, GFS2_METATYPE_DI)) { >diff --git a/gfs2/fsck/pass1c.c b/gfs2/fsck/pass1c.c >index 12a0cc8..5ea49b6 100644 >--- a/gfs2/fsck/pass1c.c >+++ b/gfs2/fsck/pass1c.c >@@ -22,12 +22,12 @@ > #include "metawalk.h" > > static int remove_eattr_entry(struct gfs2_sbd *sdp, >- struct gfs2_buffer_head *leaf_bh, >- struct gfs2_ea_header *curr, >- struct gfs2_ea_header *prev) >+ struct gfs2_buffer_head *leaf_bh, >+ struct gfs2_ea_header *curr, >+ struct gfs2_ea_header *prev) > { > log_warn("Removing EA located in block #%"PRIu64" (0x%" PRIx64 ").\n", >- leaf_bh->b_blocknr, leaf_bh->b_blocknr); >+ leaf_bh->b_blocknr, leaf_bh->b_blocknr); > if(!prev) > curr->ea_type = GFS2_EATYPE_UNUSED; > else { >@@ -50,7 +50,11 @@ int check_eattr_indir(struct gfs2_inode *ip, uint64_t block, > struct gfs2_buffer_head *indir_bh = NULL; > > if(gfs2_check_range(sbp, block)) { >- log_err("Extended attributes indirect block out of range...removing\n"); >+ log_err("Extended attributes indirect block #%"PRIu64 >+ " (0x%" PRIx64 ") for inode #%" PRIu64 >+ " (0x%" PRIx64 ") out of range...removing\n", >+ block, block, ip->i_di.di_num.no_addr, >+ ip->i_di.di_num.no_addr); > ip->i_di.di_eattr = 0; > *update = (opts.no ? not_updated : updated); > return 1; >@@ -60,7 +64,11 @@ int check_eattr_indir(struct gfs2_inode *ip, uint64_t block, > return -1; > } > else if(q.block_type != gfs2_indir_blk) { >- log_err("Extended attributes indirect block invalid...removing\n"); >+ log_err("Extended attributes indirect block #%"PRIu64 >+ " (0x%" PRIx64 ") for inode #%" PRIu64 >+ " (0x%" PRIx64 ") invalid...removing\n", >+ block, block, ip->i_di.di_num.no_addr, >+ ip->i_di.di_num.no_addr); > ip->i_di.di_eattr = 0; > *update = (opts.no ? not_updated : updated); > return 1; >@@ -79,7 +87,9 @@ int check_eattr_leaf(struct gfs2_inode *ip, uint64_t block, > struct gfs2_block_query q; > > if(gfs2_check_range(sbp, block)) { >- log_err("Extended attributes block out of range...removing\n"); >+ log_err("Extended attributes block for inode #%" PRIu64 >+ " (0x%" PRIx64 ") out of range...removing\n", >+ ip->i_di.di_num.no_addr, ip->i_di.di_num.no_addr); > ip->i_di.di_eattr = 0; > *update = (opts.no ? not_updated : updated); > return 1; >@@ -89,7 +99,9 @@ int check_eattr_leaf(struct gfs2_inode *ip, uint64_t block, > return -1; > } > else if(q.block_type != gfs2_meta_eattr) { >- log_err("Extended attributes block invalid...removing\n"); >+ log_err("Extended attributes block for inode #%"PRIu64 >+ " (0x%" PRIx64 ") invalid...removing\n", >+ ip->i_di.di_num.no_addr, ip->i_di.di_num.no_addr); > ip->i_di.di_eattr = 0; > *update = (opts.no ? not_updated : updated); > return 1;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 404611
:
272991
|
273071
|
311604
|
311988
|
312174
|
312404
|
312571