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 920713 Details for
Bug 516025
GFS2: couldn't free all objects in gfs2_bufdata cache on unload
[?]
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]
GFS2: Detect and release delayed bufdata structures
bz516025.addendum2.patch (text/plain), 3.34 KB, created by
Robert Peterson
on 2014-07-24 19:36:50 UTC
(
hide
)
Description:
GFS2: Detect and release delayed bufdata structures
Filename:
MIME Type:
Creator:
Robert Peterson
Created:
2014-07-24 19:36:50 UTC
Size:
3.34 KB
patch
obsolete
>commit d23534b028f5e273deeca84157ee18ff07c3d0c1 >Author: Bob Peterson <rpeterso@redhat.com> >Date: Thu Jul 24 14:13:17 2014 -0500 > > GFS2: Detect and release delayed bufdata structures > > In ordinary cases, writes are buffered on the ordered writes list and > inodes are cached for a while. When another node wants to write to the > same file, the glock is demoted, the inode's pages and buffers are > truncated, and function gfs2_releasepage frees the buffers. However, in > some rare circumstances, a timing window can occur when another node > requests an inode (and therefore causes an invalidate to occur) while > the inode's buffers are actively being written from the ordered writes > list. In those cases, the buffer (and its corresponding bd element) > cannot be freed because b_count is non-zero until the IO is complete. > > This timing window does not exist in RHEL6 and above because the code > for writing the ordered writes list was reworked so that each inode > has its own ordered writes list and uses filemap_fdatawrite to write it. > That patch is too big and porting it too risky for RHEL5, so this patch > is an attempt to get around the problem and still allow it to free > the bd elements properly. > > When an invalidate operation occurs, this patch marks any buffer_heads > that can't be released due to b_count being non-zero during > gfs2_releasepage. If these marked buffer_heads are found in > gfs2_ordered_wait, we know the buffers are no longer needed, and they > are freed at that time. > > rhbz#516025 >--- > fs/gfs2/incore.h | 3 +++ > fs/gfs2/log.c | 6 ++++++ > fs/gfs2/ops_address.c | 8 ++++++-- > 3 files changed, 15 insertions(+), 2 deletions(-) > >diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h >index 07cb732..e1eeb6f 100644 >--- a/fs/gfs2/incore.h >+++ b/fs/gfs2/incore.h >@@ -96,12 +96,15 @@ struct gfs2_rgrpd { > enum gfs2_state_bits { > BH_Pinned = BH_PrivateStart, > BH_Escaped = BH_PrivateStart + 1, >+ BH_Release = BH_PrivateStart + 2, /* Needs its bd released */ > }; > > BUFFER_FNS(Pinned, pinned) > TAS_BUFFER_FNS(Pinned, pinned) > BUFFER_FNS(Escaped, escaped) > TAS_BUFFER_FNS(Escaped, escaped) >+BUFFER_FNS(Release, release) >+TAS_BUFFER_FNS(Release, release) > > struct gfs2_bufdata { > struct buffer_head *bd_bh; >diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c >index b3aeda1..a547106 100644 >--- a/fs/gfs2/log.c >+++ b/fs/gfs2/log.c >@@ -844,6 +844,12 @@ static void gfs2_ordered_wait(struct gfs2_sbd *sdp) > get_bh(bh); > gfs2_log_unlock(sdp); > wait_on_buffer(bh); >+ if (test_clear_buffer_release(bh)) { >+ bd->bd_bh = NULL; >+ bh->b_private = NULL; >+ list_del_init(&bd->bd_le.le_list); >+ kmem_cache_free(gfs2_bufdata_cachep, bd); >+ } > brelse(bh); > gfs2_log_lock(sdp); > continue; >diff --git a/fs/gfs2/ops_address.c b/fs/gfs2/ops_address.c >index 7ed96ce..f22ee46 100644 >--- a/fs/gfs2/ops_address.c >+++ b/fs/gfs2/ops_address.c >@@ -1312,8 +1312,12 @@ int gfs2_releasepage(struct page *page, gfp_t gfp_mask) > gfs2_log_lock(sdp); > head = bh = page_buffers(page); > do { >- if (atomic_read(&bh->b_count)) >- goto cannot_release; >+ if (atomic_read(&bh->b_count)) { >+ set_buffer_release(bh); /* release later */ >+ if (atomic_read(&bh->b_count)) /* Sometimes it fixes >+ itself. */ >+ goto cannot_release; >+ } > bd = bh->b_private; > if (bd && bd->bd_ail) > goto cannot_release;
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 516025
:
838395
|
916771
| 920713