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 296251 Details for
Bug 434736
GFS2: gfs2_adjust_quota has broken unstuffing code
[?]
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 correct lock ordering in gfs2_adjust_quota
bz434736-try2.patch (text/plain), 2.28 KB, created by
Abhijith Das
on 2008-02-28 19:49:55 UTC
(
hide
)
Description:
patch to correct lock ordering in gfs2_adjust_quota
Filename:
MIME Type:
Creator:
Abhijith Das
Created:
2008-02-28 19:49:55 UTC
Size:
2.28 KB
patch
obsolete
>--- quota.c.orig 2008-02-25 11:54:40.000000000 -0600 >+++ quota.c 2008-02-28 13:36:09.000000000 -0600 >@@ -617,16 +617,9 @@ static int gfs2_adjust_quota(struct gfs2 > s64 value; > int err = -EIO; > >- if (gfs2_is_stuffed(ip)) { >- struct gfs2_alloc *al = NULL; >- al = gfs2_alloc_get(ip); >- /* just request 1 blk */ >- al->al_requested = 1; >- gfs2_inplace_reserve(ip); >+ if (gfs2_is_stuffed(ip)) > gfs2_unstuff_dinode(ip, NULL); >- gfs2_inplace_release(ip); >- gfs2_alloc_put(ip); >- } >+ > page = grab_cache_page(mapping, index); > if (!page) > return -ENOMEM; >@@ -691,7 +684,7 @@ static int do_sync(unsigned int num_qd, > unsigned int qx, x; > struct gfs2_quota_data *qd; > loff_t offset; >- unsigned int nalloc = 0; >+ unsigned int nalloc = 0, blocks; > struct gfs2_alloc *al = NULL; > int error; > >@@ -728,30 +721,30 @@ static int do_sync(unsigned int num_qd, > nalloc++; > } > >- if (nalloc) { > al = gfs2_alloc_get(ip); >+ /* >+ * 1 blk for unstuffing inode if stuffed. We add this extra >+ * block to the reservation unconditionally. If the inode >+ * doesn't need unstuffing, the block will be released to the >+ * rgrp since it won't be allocated during the transaction >+ */ >+ al->al_requested = 1; >+ /* +1 in the end for block requested above for unstuffing */ >+ blocks = num_qd * data_blocks + RES_DINODE + num_qd + 1; > >- al->al_requested = nalloc * (data_blocks + ind_blocks); >+ if (nalloc) >+ al->al_requested += nalloc * (data_blocks + ind_blocks); > > error = gfs2_inplace_reserve(ip); > if (error) > goto out_alloc; > >- error = gfs2_trans_begin(sdp, >- al->al_rgd->rd_length + >- num_qd * data_blocks + >- nalloc * ind_blocks + >- RES_DINODE + num_qd + >- RES_STATFS, 0); >+ if (nalloc) >+ blocks += al->al_rgd->rd_length + nalloc * ind_blocks + RES_STATFS; >+ >+ error = gfs2_trans_begin(sdp, blocks, 0); > if (error) > goto out_ipres; >- } else { >- error = gfs2_trans_begin(sdp, >- num_qd * data_blocks + >- RES_DINODE + num_qd, 0); >- if (error) >- goto out_gunlock; >- } > > for (x = 0; x < num_qd; x++) { > qd = qda[x]; >@@ -770,10 +763,8 @@ static int do_sync(unsigned int num_qd, > out_end_trans: > gfs2_trans_end(sdp); > out_ipres: >- if (nalloc) > gfs2_inplace_release(ip); > out_alloc: >- if (nalloc) > gfs2_alloc_put(ip); > out_gunlock: > gfs2_glock_dq_uninit(&i_gh);
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 434736
: 296251 |
296564