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 311604 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]
Second prototype patch
404611.prototype2.patch (text/plain), 8.26 KB, created by
Robert Peterson
on 2008-07-11 16:50:41 UTC
(
hide
)
Description:
Second prototype patch
Filename:
MIME Type:
Creator:
Robert Peterson
Created:
2008-07-11 16:50:41 UTC
Size:
8.26 KB
patch
obsolete
> gfs2/fsck/pass1.c | 195 +++++++++++++++++++++++++++++++++++++---------------- > 1 files changed, 137 insertions(+), 58 deletions(-) > >diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c >index b00331d..4b50f17 100644 >--- a/gfs2/fsck/pass1.c >+++ b/gfs2/fsck/pass1.c >@@ -133,8 +133,8 @@ 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) >+ uint64_t parent, struct gfs2_buffer_head **bh, >+ void *private) > { > struct gfs2_sbd *sdp = ip->i_sbd; > int ret = 0; >@@ -155,13 +155,6 @@ static int check_eattr_indir(struct gfs2_inode *ip, uint64_t indirect, > stack; > ret = -1; > } >- else if(q.block_type != gfs2_block_free) { >- log_debug("Duplicate block found at #%" PRIu64 " (0x%" PRIx64 ").\n", >- indirect, indirect); >- gfs2_block_set(bl, indirect, gfs2_dup_block); >- bc->ea_count++; >- ret = 1; >- } > else { > log_debug("Marking inode %" PRIu64 " (0x%" > PRIx64 ") with eattr block\n", >@@ -170,21 +163,53 @@ static int check_eattr_indir(struct gfs2_inode *ip, uint64_t indirect, > so pass1c can check it. */ > gfs2_block_mark(bl, ip->i_di.di_num.no_addr, gfs2_eattr_block); > >+ /* 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)) { >- 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++; >+ if(q.block_type != gfs2_block_free) { /* Duplicate? */ >+ log_err("Inode #%" PRIu64 " (0x%" PRIx64 "): " >+ "Bad indirect EA duplicate found.\n", >+ ip->i_di.di_num.no_addr, >+ ip->i_di.di_num.no_addr); >+ if(query(&opts, "Clear the bad EA? (y/n) ")) { >+ ip->i_di.di_eattr = 0; >+ gfs2_dinode_out(&ip->i_di, >+ ip->i_bh->b_data); >+ ret = -1; >+ brelse(*bh, not_updated); >+ } else { >+ log_err("The bad EA was not fixed.\n"); >+ gfs2_block_set(bl, indirect, >+ gfs2_dup_block); >+ bc->ea_count++; >+ ret = 1; >+ } >+ } else { >+ 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 { >+ if(q.block_type != gfs2_block_free) { /* Duplicate? */ >+ log_debug("Duplicate block found at #%" PRIu64 >+ " (0x%" PRIx64 ").\n", >+ 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++; >+ } > } > } > return ret; >@@ -212,6 +237,7 @@ 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 >@@ -224,28 +250,54 @@ 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? */ >+ log_err("Inode #%" PRIu64 " (0x%" PRIx64 >+ "): Bad extended EA duplicate found.\n", >+ ip->i_di.di_num.no_addr, >+ ip->i_di.di_num.no_addr); >+ if(query(&opts, "Clear the bad extended EA? (y/n) ")) { >+ ip->i_di.di_eattr = 0; >+ gfs2_dinode_out(&ip->i_di, ip->i_bh->b_data); >+ ret = -1; >+ } else { >+ log_err("The bad EA was not fixed.\n"); >+ gfs2_block_set(bl, el_blk, gfs2_dup_block); >+ bc->ea_count++; >+ ret = 1; >+ } >+ } else { >+ log_err("EA extended leaf block %" PRIu64 >+ " (0x%" PRIx64 ") has incorrect type.\n", >+ el_blk, el_blk); >+ gfs2_block_set(bl, el_blk, gfs2_meta_inval); >+ 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, >@@ -277,30 +329,57 @@ 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; >- brelse(leaf_bh, not_updated); >+ if(q.block_type != gfs2_block_free) { /* Duplicate? */ >+ log_err("Inode #%" PRIu64 " (0x%" PRIx64 >+ "): Bad EA duplicate found.\n", >+ ip->i_di.di_num.no_addr, >+ ip->i_di.di_num.no_addr); >+ if(query(&opts, "Clear the bad EA? (y/n) ")) { >+ ip->i_di.di_eattr = 0; >+ gfs2_dinode_out(&ip->i_di, >+ ip->i_bh->b_data); >+ ret = -1; >+ brelse(leaf_bh, not_updated); >+ } else { >+ log_err("The bad EA was not fixed.\n"); >+ gfs2_block_set(bl, block, >+ gfs2_dup_block); >+ bc->ea_count++; >+ ret = 1; >+ } >+ } else { >+ 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; >+ 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; >+ } 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;
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