Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 412899 Details for
Bug 589823
gfs2_convert doesn't convert quota files
Home
New
Search
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.rh92 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]
Convert quota inode correctly
bz589823.patch (text/plain), 3.22 KB, created by
Abhijith Das
on 2010-05-10 16:42:51 UTC
(
hide
)
Description:
Convert quota inode correctly
Filename:
MIME Type:
Creator:
Abhijith Das
Created:
2010-05-10 16:42:51 UTC
Size:
3.22 KB
patch
obsolete
>diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c >index 9621a09..642d26a 100644 >--- a/gfs2/convert/gfs2_convert.c >+++ b/gfs2/convert/gfs2_convert.c >@@ -324,6 +324,7 @@ static void fix_metatree(struct gfs2_sbd *sbp, struct gfs2_inode *ip, > bh = ip->i_bh; > /* First, build up the metatree */ > for (h = 0; h < blk->height; h++) { >+ new = 0; > lookup_block(ip, bh, h, &blk->mp, 1, &new, &block); > if (bh != ip->i_bh) > brelse(bh); >@@ -643,8 +644,6 @@ static void fix_jdatatree(struct gfs2_sbd *sbp, struct gfs2_inode *ip, > mh.mh_type = GFS2_METATYPE_IN; > mh.mh_format = GFS2_FORMAT_IN; > >- /* This condition should never arise. >- We're always dealing with unstuffed inodes */ > if (!ip->i_di.di_height) > unstuff_dinode(ip); > >@@ -655,6 +654,7 @@ static void fix_jdatatree(struct gfs2_sbd *sbp, struct gfs2_inode *ip, > bh = ip->i_bh; > /* First, build up the metatree */ > for (h = 0; h < blk->height; h++) { >+ new = 0; > lookup_block(ip, bh, h, &blk->mp, 1, &new, &block); > if (bh != ip->i_bh) > brelse(bh); >@@ -819,7 +819,7 @@ static int adjust_jdata_inode(struct gfs2_sbd *sbp, struct gfs2_inode *ip) > unsigned int len; > > blk = osi_list_entry(tmp, struct blocklist, list); >- /* If it's not a data block at the highest level */ >+ /* If it's not a highest level indirect block */ > if (blk->height != di_height - 1) { > osi_list_del(tmp); > free(blk->ptrbuf); >@@ -2105,6 +2105,40 @@ static int check_fit(struct gfs2_sbd *sdp) > return blks_avail > blks_need; > } > >+/* We fetch the old quota inode block and copy the contents of the block >+ * (minus the struct gfs2_dinode) into the new quota block. We update the >+ * inode height/size of the new quota file to that of the old one and set the >+ * old quota inode height/size to zero, so only the inode block gets freed. >+ */ >+static void copy_quotas(struct gfs2_sbd *sdp) >+{ >+ struct gfs2_inum inum; >+ struct gfs2_inode *oq_ip, *nq_ip; >+ int err; >+ >+ err = gfs2_lookupi(sdp->master_dir, "quota", 5, &nq_ip); >+ if (err) >+ die("Couldn't lookup new quota file: %d\n", err); >+ >+ gfs2_inum_in(&inum, (char *)&raw_gfs1_ondisk_sb.sb_quota_di); >+ oq_ip = inode_read(sdp, inum.no_addr); >+ >+ nq_ip->i_di.di_height = oq_ip->i_di.di_height; >+ nq_ip->i_di.di_size = oq_ip->i_di.di_size; >+ memcpy(nq_ip->i_bh->b_data + sizeof(struct gfs2_dinode), >+ oq_ip->i_bh->b_data + sizeof(struct gfs2_dinode), >+ sdp->bsize - sizeof(struct gfs2_dinode)); >+ >+ oq_ip->i_di.di_height = 0; >+ oq_ip->i_di.di_size = 0; >+ >+ bmodified(nq_ip->i_bh); >+ inode_put(&nq_ip); >+ >+ bmodified(oq_ip->i_bh); >+ inode_put(&oq_ip); >+} >+ > /* ------------------------------------------------------------------------- */ > /* main - mainline code */ > /* ------------------------------------------------------------------------- */ >@@ -2226,6 +2260,15 @@ int main(int argc, char **argv) > /* Create the quota file */ > build_quota(&sb2); > >+ /* Copy out the master dinode */ >+ { >+ struct gfs2_inode *ip = sb2.master_dir; >+ if (ip->i_bh->b_modified) >+ gfs2_dinode_out(&ip->i_di, ip->i_bh); >+ } >+ /* Copy old quotas */ >+ copy_quotas(&sb2); >+ > update_inode_file(&sb2); > /* Now delete the now-obsolete gfs1 files: */ > remove_obsolete_gfs1(&sb2);
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 589823
: 412899