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 291295 Details for
Bug 428291
GFS2: Reduce gfs2 memory requirements
[?]
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
428291.rhel5.i_alloc.patch (text/plain), 11.12 KB, created by
Robert Peterson
on 2008-01-10 16:08:06 UTC
(
hide
)
Description:
Patch to fix the problem
Filename:
MIME Type:
Creator:
Robert Peterson
Created:
2008-01-10 16:08:06 UTC
Size:
11.12 KB
patch
obsolete
>diff -pur a/linux-2.6.18.i686/fs/gfs2/bmap.c b/linux-2.6.18.i686/fs/gfs2/bmap.c >--- a/linux-2.6.18.i686/fs/gfs2/bmap.c 2008-01-07 12:14:56.000000000 -0600 >+++ b/linux-2.6.18.i686/fs/gfs2/bmap.c 2008-01-07 12:42:04.000000000 -0600 >@@ -683,7 +683,7 @@ static int do_strip(struct gfs2_inode *i > if (metadata) > revokes = (height) ? sdp->sd_inptrs : sdp->sd_diptrs; > >- error = gfs2_rindex_hold(sdp, &ip->i_alloc.al_ri_gh); >+ error = gfs2_rindex_hold(sdp, &ip->i_alloc->al_ri_gh); > if (error) > return error; > >@@ -785,7 +785,7 @@ out_rg_gunlock: > out_rlist: > gfs2_rlist_free(&rlist); > out: >- gfs2_glock_dq_uninit(&ip->i_alloc.al_ri_gh); >+ gfs2_glock_dq_uninit(&ip->i_alloc->al_ri_gh); > return error; > } > >diff -pur a/linux-2.6.18.i686/fs/gfs2/dir.c b/linux-2.6.18.i686/fs/gfs2/dir.c >--- a/linux-2.6.18.i686/fs/gfs2/dir.c 2008-01-07 12:14:55.000000000 -0600 >+++ b/linux-2.6.18.i686/fs/gfs2/dir.c 2008-01-07 12:42:37.000000000 -0600 >@@ -1876,7 +1876,7 @@ static int leaf_dealloc(struct gfs2_inod > if (error) > goto out; > >- error = gfs2_rindex_hold(sdp, &dip->i_alloc.al_ri_gh); >+ error = gfs2_rindex_hold(sdp, &dip->i_alloc->al_ri_gh); > if (error) > goto out_qs; > >@@ -1949,7 +1949,7 @@ out_rg_gunlock: > gfs2_glock_dq_m(rlist.rl_rgrps, rlist.rl_ghs); > out_rlist: > gfs2_rlist_free(&rlist); >- gfs2_glock_dq_uninit(&dip->i_alloc.al_ri_gh); >+ gfs2_glock_dq_uninit(&dip->i_alloc->al_ri_gh); > out_qs: > gfs2_quota_unhold(dip); > out: >diff -pur a/linux-2.6.18.i686/fs/gfs2/eattr.c b/linux-2.6.18.i686/fs/gfs2/eattr.c >--- a/linux-2.6.18.i686/fs/gfs2/eattr.c 2008-01-07 12:14:50.000000000 -0600 >+++ b/linux-2.6.18.i686/fs/gfs2/eattr.c 2008-01-07 12:42:51.000000000 -0600 >@@ -1418,7 +1418,7 @@ out: > static int ea_dealloc_block(struct gfs2_inode *ip) > { > struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); >- struct gfs2_alloc *al = &ip->i_alloc; >+ struct gfs2_alloc *al = ip->i_alloc; > struct gfs2_rgrpd *rgd; > struct buffer_head *dibh; > int error; >diff -pur a/linux-2.6.18.i686/fs/gfs2/incore.h b/linux-2.6.18.i686/fs/gfs2/incore.h >--- a/linux-2.6.18.i686/fs/gfs2/incore.h 2008-01-07 12:14:56.000000000 -0600 >+++ b/linux-2.6.18.i686/fs/gfs2/incore.h 2008-01-07 12:43:08.000000000 -0600 >@@ -270,7 +270,7 @@ struct gfs2_inode { > struct gfs2_glock *i_gl; /* Move into i_gh? */ > struct gfs2_holder i_iopen_gh; > struct gfs2_holder i_gh; /* for prepare/commit_write only */ >- struct gfs2_alloc i_alloc; >+ struct gfs2_alloc *i_alloc; > u64 i_last_rg_alloc; > > spinlock_t i_spin; >diff -pur a/linux-2.6.18.i686/fs/gfs2/inode.c b/linux-2.6.18.i686/fs/gfs2/inode.c >--- a/linux-2.6.18.i686/fs/gfs2/inode.c 2008-01-07 12:14:59.000000000 -0600 >+++ b/linux-2.6.18.i686/fs/gfs2/inode.c 2008-01-07 12:45:29.000000000 -0600 >@@ -711,9 +711,10 @@ static int alloc_dinode(struct gfs2_inod > struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode); > int error; > >- gfs2_alloc_get(dip); >+ if (gfs2_alloc_get(dip) == NULL) >+ return -ENOMEM; > >- dip->i_alloc.al_requested = RES_DINODE; >+ dip->i_alloc->al_requested = RES_DINODE; > error = gfs2_inplace_reserve(dip); > if (error) > goto out; >@@ -900,7 +901,7 @@ fail_end_trans: > gfs2_trans_end(sdp); > > fail_ipreserv: >- if (dip->i_alloc.al_rgd) >+ if (dip->i_alloc->al_rgd) > gfs2_inplace_release(dip); > > fail_quota_locks: >diff -pur a/linux-2.6.18.i686/fs/gfs2/main.c b/linux-2.6.18.i686/fs/gfs2/main.c >--- a/linux-2.6.18.i686/fs/gfs2/main.c 2008-01-07 12:14:56.000000000 -0600 >+++ b/linux-2.6.18.i686/fs/gfs2/main.c 2008-01-07 17:29:40.000000000 -0600 >@@ -32,6 +32,7 @@ static void gfs2_init_inode_once(void *f > inode_init_once(&ip->i_inode); > spin_lock_init(&ip->i_spin); > init_rwsem(&ip->i_rw_mutex); >+ ip->i_alloc = NULL; > } > } > >diff -pur a/linux-2.6.18.i686/fs/gfs2/ops_address.c b/linux-2.6.18.i686/fs/gfs2/ops_address.c >--- a/linux-2.6.18.i686/fs/gfs2/ops_address.c 2008-01-07 12:14:56.000000000 -0600 >+++ b/linux-2.6.18.i686/fs/gfs2/ops_address.c 2008-01-07 12:47:46.000000000 -0600 >@@ -627,9 +627,10 @@ static int gfs2_write_lock_start(struct > if (ret) > goto out_unlock; > >- ip->i_alloc.al_requested = 0; > if (*alloc_required) { > al = gfs2_alloc_get(ip); >+ if (al == NULL) >+ goto out_unlock; > > ret = gfs2_quota_lock(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE); > if (ret) >@@ -770,7 +771,7 @@ static int gfs2_commit_write(struct file > struct gfs2_sbd *sdp = GFS2_SB(inode); > int error = -EOPNOTSUPP; > struct buffer_head *dibh; >- struct gfs2_alloc *al = &ip->i_alloc; >+ struct gfs2_alloc *al = ip->i_alloc; > struct gfs2_dinode *di; > > if (gfs2_assert_withdraw(sdp, gfs2_glock_is_locked_by_me(ip->i_gl))) >@@ -818,7 +819,7 @@ static int gfs2_commit_write(struct file > > brelse(dibh); > gfs2_trans_end(sdp); >- if (al->al_requested) { >+ if (al) { > gfs2_inplace_release(ip); > gfs2_quota_unlock(ip); > gfs2_alloc_put(ip); >@@ -833,7 +834,7 @@ fail: > brelse(dibh); > fail_endtrans: > gfs2_trans_end(sdp); >- if (al->al_requested) { >+ if (al) { > gfs2_inplace_release(ip); > gfs2_quota_unlock(ip); > gfs2_alloc_put(ip); >diff -pur a/linux-2.6.18.i686/fs/gfs2/ops_inode.c b/linux-2.6.18.i686/fs/gfs2/ops_inode.c >--- a/linux-2.6.18.i686/fs/gfs2/ops_inode.c 2008-01-07 12:14:55.000000000 -0600 >+++ b/linux-2.6.18.i686/fs/gfs2/ops_inode.c 2008-01-07 12:49:55.000000000 -0600 >@@ -61,7 +61,7 @@ static int gfs2_create(struct inode *dir > inode = gfs2_createi(ghs, &dentry->d_name, S_IFREG | mode, 0); > if (!IS_ERR(inode)) { > gfs2_trans_end(sdp); >- if (dip->i_alloc.al_rgd) >+ if (dip->i_alloc->al_rgd) > gfs2_inplace_release(dip); > gfs2_quota_unlock(dip); > gfs2_alloc_put(dip); >@@ -366,7 +366,7 @@ static int gfs2_symlink(struct inode *di > } > > gfs2_trans_end(sdp); >- if (dip->i_alloc.al_rgd) >+ if (dip->i_alloc->al_rgd) > gfs2_inplace_release(dip); > gfs2_quota_unlock(dip); > gfs2_alloc_put(dip); >@@ -442,7 +442,7 @@ static int gfs2_mkdir(struct inode *dir, > gfs2_assert_withdraw(sdp, !error); /* dip already pinned */ > > gfs2_trans_end(sdp); >- if (dip->i_alloc.al_rgd) >+ if (dip->i_alloc->al_rgd) > gfs2_inplace_release(dip); > gfs2_quota_unlock(dip); > gfs2_alloc_put(dip); >@@ -548,7 +548,7 @@ static int gfs2_mknod(struct inode *dir, > } > > gfs2_trans_end(sdp); >- if (dip->i_alloc.al_rgd) >+ if (dip->i_alloc->al_rgd) > gfs2_inplace_release(dip); > gfs2_quota_unlock(dip); > gfs2_alloc_put(dip); >diff -pur a/linux-2.6.18.i686/fs/gfs2/quota.c b/linux-2.6.18.i686/fs/gfs2/quota.c >--- a/linux-2.6.18.i686/fs/gfs2/quota.c 2008-01-07 12:14:55.000000000 -0600 >+++ b/linux-2.6.18.i686/fs/gfs2/quota.c 2008-01-07 12:50:17.000000000 -0600 >@@ -454,7 +454,7 @@ static void qdsb_put(struct gfs2_quota_d > int gfs2_quota_hold(struct gfs2_inode *ip, u32 uid, u32 gid) > { > struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); >- struct gfs2_alloc *al = &ip->i_alloc; >+ struct gfs2_alloc *al = ip->i_alloc; > struct gfs2_quota_data **qd = al->al_qd; > int error; > >@@ -502,7 +502,7 @@ out: > void gfs2_quota_unhold(struct gfs2_inode *ip) > { > struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); >- struct gfs2_alloc *al = &ip->i_alloc; >+ struct gfs2_alloc *al = ip->i_alloc; > unsigned int x; > > gfs2_assert_warn(sdp, !test_bit(GIF_QD_LOCKED, &ip->i_flags)); >@@ -856,7 +856,7 @@ fail: > int gfs2_quota_lock(struct gfs2_inode *ip, u32 uid, u32 gid) > { > struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); >- struct gfs2_alloc *al = &ip->i_alloc; >+ struct gfs2_alloc *al = ip->i_alloc; > unsigned int x; > int error = 0; > >@@ -924,7 +924,7 @@ static int need_sync(struct gfs2_quota_d > > void gfs2_quota_unlock(struct gfs2_inode *ip) > { >- struct gfs2_alloc *al = &ip->i_alloc; >+ struct gfs2_alloc *al = ip->i_alloc; > struct gfs2_quota_data *qda[4]; > unsigned int count = 0; > unsigned int x; >@@ -972,7 +972,7 @@ static int print_message(struct gfs2_quo > int gfs2_quota_check(struct gfs2_inode *ip, u32 uid, u32 gid) > { > struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); >- struct gfs2_alloc *al = &ip->i_alloc; >+ struct gfs2_alloc *al = ip->i_alloc; > struct gfs2_quota_data *qd; > s64 value; > unsigned int x; >@@ -1016,7 +1016,7 @@ int gfs2_quota_check(struct gfs2_inode * > void gfs2_quota_change(struct gfs2_inode *ip, s64 change, > u32 uid, u32 gid) > { >- struct gfs2_alloc *al = &ip->i_alloc; >+ struct gfs2_alloc *al = ip->i_alloc; > struct gfs2_quota_data *qd; > unsigned int x; > unsigned int found = 0; >diff -pur a/linux-2.6.18.i686/fs/gfs2/rgrp.c b/linux-2.6.18.i686/fs/gfs2/rgrp.c >--- a/linux-2.6.18.i686/fs/gfs2/rgrp.c 2008-01-07 12:14:57.000000000 -0600 >+++ b/linux-2.6.18.i686/fs/gfs2/rgrp.c 2008-01-07 12:50:48.000000000 -0600 >@@ -817,11 +817,9 @@ void gfs2_rgrp_repolish_clones(struct gf > > struct gfs2_alloc *gfs2_alloc_get(struct gfs2_inode *ip) > { >- struct gfs2_alloc *al = &ip->i_alloc; >- >- /* FIXME: Should assert that the correct locks are held here... */ >- memset(al, 0, sizeof(*al)); >- return al; >+ BUG_ON(ip->i_alloc != NULL); >+ ip->i_alloc = kzalloc(sizeof(struct gfs2_alloc), GFP_KERNEL); >+ return ip->i_alloc; > } > > /** >@@ -1059,7 +1057,7 @@ static struct inode *get_local_rgrp(stru > struct inode *inode = NULL; > struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); > struct gfs2_rgrpd *rgd, *begin = NULL; >- struct gfs2_alloc *al = &ip->i_alloc; >+ struct gfs2_alloc *al = ip->i_alloc; > int flags = LM_FLAG_TRY; > int skipped = 0; > int loops = 0; >@@ -1174,7 +1172,7 @@ out: > int gfs2_inplace_reserve_i(struct gfs2_inode *ip, char *file, unsigned int line) > { > struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); >- struct gfs2_alloc *al = &ip->i_alloc; >+ struct gfs2_alloc *al = ip->i_alloc; > struct inode *inode; > int error = 0; > u64 last_unlinked = NO_BLOCK; >@@ -1220,7 +1218,7 @@ try_again: > void gfs2_inplace_release(struct gfs2_inode *ip) > { > struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); >- struct gfs2_alloc *al = &ip->i_alloc; >+ struct gfs2_alloc *al = ip->i_alloc; > > if (gfs2_assert_warn(sdp, al->al_alloced <= al->al_requested) == -1) > fs_warn(sdp, "al_alloced = %u, al_requested = %u " >@@ -1411,7 +1409,7 @@ static struct gfs2_rgrpd *rgblk_free(str > u64 gfs2_alloc_data(struct gfs2_inode *ip) > { > struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); >- struct gfs2_alloc *al = &ip->i_alloc; >+ struct gfs2_alloc *al = ip->i_alloc; > struct gfs2_rgrpd *rgd = al->al_rgd; > u32 goal, blk; > u64 block; >@@ -1456,7 +1454,7 @@ u64 gfs2_alloc_data(struct gfs2_inode *i > u64 gfs2_alloc_meta(struct gfs2_inode *ip) > { > struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); >- struct gfs2_alloc *al = &ip->i_alloc; >+ struct gfs2_alloc *al = ip->i_alloc; > struct gfs2_rgrpd *rgd = al->al_rgd; > u32 goal, blk; > u64 block; >@@ -1502,7 +1500,7 @@ u64 gfs2_alloc_meta(struct gfs2_inode *i > u64 gfs2_alloc_di(struct gfs2_inode *dip, u64 *generation) > { > struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode); >- struct gfs2_alloc *al = &dip->i_alloc; >+ struct gfs2_alloc *al = dip->i_alloc; > struct gfs2_rgrpd *rgd = al->al_rgd; > u32 blk; > u64 block; >diff -pur a/linux-2.6.18.i686/fs/gfs2/rgrp.h b/linux-2.6.18.i686/fs/gfs2/rgrp.h >--- a/linux-2.6.18.i686/fs/gfs2/rgrp.h 2008-01-07 12:14:46.000000000 -0600 >+++ b/linux-2.6.18.i686/fs/gfs2/rgrp.h 2008-01-07 12:51:01.000000000 -0600 >@@ -32,7 +32,9 @@ void gfs2_rgrp_repolish_clones(struct gf > struct gfs2_alloc *gfs2_alloc_get(struct gfs2_inode *ip); > static inline void gfs2_alloc_put(struct gfs2_inode *ip) > { >- return; /* So we can see where ip->i_alloc is used */ >+ BUG_ON(ip->i_alloc == NULL); >+ kfree(ip->i_alloc); >+ ip->i_alloc = NULL; > } > > int gfs2_inplace_reserve_i(struct gfs2_inode *ip,
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 428291
: 291295