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 271451 Details for
Bug 402971
GFS2: gfs2_edit savemeta doesn't save rindex file
[?]
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]
Patch to fix the problem
402971.gfs2_edit.patch (text/plain), 3.69 KB, created by
Robert Peterson
on 2007-11-28 16:41:35 UTC
(
hide
)
Description:
Patch to fix the problem
Filename:
MIME Type:
Creator:
Robert Peterson
Created:
2007-11-28 16:41:35 UTC
Size:
3.69 KB
patch
obsolete
>Index: hexedit.h >=================================================================== >RCS file: /cvs/cluster/cluster/gfs2/edit/hexedit.h,v >retrieving revision 1.14 >diff -w -u -p -p -u -r1.14 hexedit.h >--- hexedit.h 13 Nov 2007 17:22:06 -0000 1.14 >+++ hexedit.h 28 Nov 2007 16:34:33 -0000 >@@ -136,6 +136,7 @@ struct gfs_log_header { > }; > > EXTERN int block_is_jindex(void); >+EXTERN int block_is_rindex(void); > EXTERN int block_is_inum_file(void); > EXTERN int block_is_statfs_file(void); > EXTERN int block_is_quota_file(void); >Index: savemeta.c >=================================================================== >RCS file: /cvs/cluster/cluster/gfs2/edit/savemeta.c,v >retrieving revision 1.6 >diff -w -u -p -p -u -r1.6 savemeta.c >--- savemeta.c 15 Nov 2007 20:32:42 -0000 1.6 >+++ savemeta.c 28 Nov 2007 16:34:33 -0000 >@@ -383,7 +383,7 @@ int get_gfs_struct_info(char *buf, int * > struct gfs2_meta_header mh; > > *block_type = 0; >- *struct_len = 0; >+ *struct_len = bufsize; > > gfs2_meta_header_in(&mh, buf); > if (mh.mh_magic != GFS2_MAGIC) >@@ -492,6 +492,7 @@ int block_is_systemfile(void) > block_is_inum_file() || > block_is_statfs_file() || > block_is_quota_file() || >+ block_is_rindex() || > block_is_a_journal(); > } > >@@ -501,6 +502,12 @@ int save_block(int fd, int out_fd, uint6 > uint16_t trailing0; > char *p; > >+ if (blk > last_fs_block) { >+ fprintf(stderr, "\nWarning: bad block pointer ignored in " >+ "block (block %llu (%llx))", >+ (unsigned long long)block, (unsigned long long)block); >+ return 0; >+ } > memset(savedata, 0, sizeof(struct saved_metablock)); > do_lseek(fd, blk * bufsize); > do_read(fd, savedata->buf, bufsize); /* read in the block */ >@@ -536,12 +543,11 @@ int save_block(int fd, int out_fd, uint6 > void save_indirect_blocks(int out_fd, osi_list_t *cur_list, > struct gfs2_buffer_head *mybh, int height, int hgt) > { >- uint64_t old_block = 0, starting_block; >+ uint64_t old_block = 0, indir_block; > uint64_t *ptr; > int head_size; > struct gfs2_buffer_head *nbh; > >- starting_block = block; /* remember where we started */ > head_size = (hgt > 1 ? > sizeof(struct gfs2_meta_header) : > sizeof(struct gfs2_dinode)); >@@ -550,19 +556,18 @@ void save_indirect_blocks(int out_fd, os > (char *)ptr < (mybh->b_data + mybh->b_size); ptr++) { > if (!*ptr) > continue; >- block = be64_to_cpu(*ptr); >- if (block == old_block) >+ indir_block = be64_to_cpu(*ptr); >+ if (indir_block == old_block) > continue; >- old_block = block; >- save_block(sbd.device_fd, out_fd, block); >+ old_block = indir_block; >+ save_block(sbd.device_fd, out_fd, indir_block); > if (height != hgt) { /* If not at max height */ >- nbh = bread(&sbd, block); >+ nbh = bread(&sbd, indir_block); > osi_list_add_prev(&nbh->b_altlist, > cur_list); > brelse(nbh, not_updated); > } > } /* for all data on the indirect block */ >- block = starting_block; /* go back to where we started */ > } > > /* >@@ -632,10 +637,13 @@ void save_inode_data(int out_fd) > } > if (inode->i_di.di_eattr) { /* if this inode has extended attributes */ > struct gfs2_ea_header ea; >+ struct gfs2_meta_header mh; > int e; > > metabh = bread(&sbd, inode->i_di.di_eattr); > save_block(sbd.device_fd, out_fd, inode->i_di.di_eattr); >+ gfs2_meta_header_in(&mh, metabh->b_data); >+ if (mh.mh_magic == GFS2_MAGIC) { > for (e = sizeof(struct gfs2_meta_header); > e < bufsize; e += ea.ea_rec_len) { > uint64_t blk, *b; >@@ -655,6 +663,12 @@ void save_inode_data(int out_fd) > if (!ea.ea_rec_len) > break; > } >+ } else { >+ fprintf(stderr, "\nWarning: corrupt extended attribute" >+ " at block %llu (0x%llx) detected.\n", >+ (unsigned long long)block, >+ (unsigned long long)block); >+ } > brelse(metabh, not_updated); > } > inode_put(inode, not_updated);
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 402971
: 271451