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 298191 Details for
Bug 432057
GFS2: d_doio stuck in readv() waiting for pagelock.
[?]
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]
another version of my patch that handles more readpage callers
readpage_try2.patch (text/plain), 9.17 KB, created by
Ben Marzinski
on 2008-03-16 13:24:33 UTC
(
hide
)
Description:
another version of my patch that handles more readpage callers
Filename:
MIME Type:
Creator:
Ben Marzinski
Created:
2008-03-16 13:24:33 UTC
Size:
9.17 KB
patch
obsolete
>diff -urpN gfs2/glock.h gfs2-patched/glock.h >--- gfs2/glock.h 2008-03-16 01:32:06.000000000 -0500 >+++ gfs2-patched/glock.h 2008-03-14 10:10:22.000000000 -0500 >@@ -31,22 +31,21 @@ > #define GLR_TRYFAILED 13 > #define GLR_CANCELED 14 > >-static inline int gfs2_glock_is_locked_by_me(struct gfs2_glock *gl) >+static inline struct gfs2_holder *gfs2_glock_is_locked_by_me(struct gfs2_glock *gl) > { > struct gfs2_holder *gh; >- int locked = 0; > > /* Look in glock's list of holders for one with current task as owner */ > spin_lock(&gl->gl_spin); > list_for_each_entry(gh, &gl->gl_holders, gh_list) { >- if (gh->gh_owner_pid == current->pid) { >- locked = 1; >- break; >- } >+ if (gh->gh_owner_pid == current->pid) >+ goto out; > } >+ gh = NULL; >+out: > spin_unlock(&gl->gl_spin); > >- return locked; >+ return gh; > } > > static inline int gfs2_glock_is_held_excl(struct gfs2_glock *gl) >diff -urpN gfs2/inode.c gfs2-patched/inode.c >--- gfs2/inode.c 2008-03-16 01:32:06.000000000 -0500 >+++ gfs2-patched/inode.c 2008-03-14 10:10:22.000000000 -0500 >@@ -491,7 +491,7 @@ struct inode *gfs2_lookupi(struct inode > return dir; > } > >- if (gfs2_glock_is_locked_by_me(dip->i_gl) == 0) { >+ if (gfs2_glock_is_locked_by_me(dip->i_gl) == NULL) { > error = gfs2_glock_nq_init(dip->i_gl, LM_ST_SHARED, 0, &d_gh); > if (error) > return ERR_PTR(error); >diff -urpN gfs2/ops_address.c gfs2-patched/ops_address.c >--- gfs2/ops_address.c 2008-03-16 01:32:06.000000000 -0500 >+++ gfs2-patched/ops_address.c 2008-03-14 10:10:22.000000000 -0500 >@@ -479,9 +479,8 @@ static int gfs2_readpage(struct file *fi > struct gfs2_inode *ip = GFS2_I(page->mapping->host); > struct gfs2_sbd *sdp = GFS2_SB(page->mapping->host); > struct gfs2_file *gf = NULL; >- struct gfs2_holder gh; >+ struct gfs2_holder *gh = NULL; > int error; >- int do_unlock = 0; > > if (likely(file != &gfs2_internal_file_sentinel)) { > if (file) { >@@ -490,11 +489,19 @@ static int gfs2_readpage(struct file *fi > /* gfs2_sharewrite_nopage has grabbed the ip->i_gl already */ > goto skip_lock; > } >- gfs2_holder_init(ip->i_gl, LM_ST_SHARED, GL_ATIME|LM_FLAG_TRY_1CB, &gh); >- do_unlock = 1; >- error = gfs2_glock_nq_atime(&gh); >- if (unlikely(error)) >- goto out_unlock; >+ gh = gfs2_glock_is_locked_by_me(ip->i_gl); >+ if (!gh) { >+ gh = kmalloc(sizeof(struct gfs2_holder), GFP_NOFS); >+ if (!gh) >+ return -ENOBUFS; >+ gfs2_holder_init(ip->i_gl, LM_ST_SHARED, GL_ATIME, gh); >+ gh->gh_ip = (unsigned long)__builtin_return_address(0); >+ unlock_page(page); >+ error = gfs2_glock_nq_atime(gh); >+ if (unlikely(error != 0)) >+ goto out; >+ return AOP_TRUNCATED_PAGE; >+ } > } > > skip_lock: >@@ -507,21 +514,13 @@ skip_lock: > if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) > error = -EIO; > >- if (do_unlock) { >- gfs2_glock_dq_m(1, &gh); >- gfs2_holder_uninit(&gh); >- } >+ if (gh) { >+ gfs2_glock_dq(gh); > out: >- return error; >-out_unlock: >- unlock_page(page); >- if (error == GLR_TRYFAILED) { >- error = AOP_TRUNCATED_PAGE; >- yield(); >+ gfs2_holder_uninit(gh); >+ kfree(gh); > } >- if (do_unlock) >- gfs2_holder_uninit(&gh); >- goto out; >+ return error; > } > > /** >diff -urpN gfs2/ops_dentry.c gfs2-patched/ops_dentry.c >--- gfs2/ops_dentry.c 2008-03-16 01:32:06.000000000 -0500 >+++ gfs2-patched/ops_dentry.c 2008-03-14 10:10:22.000000000 -0500 >@@ -44,7 +44,7 @@ static int gfs2_drevalidate(struct dentr > struct gfs2_holder d_gh; > struct gfs2_inode *ip = NULL; > int error; >- int had_lock=0; >+ int had_lock = 0; > > if (inode) { > if (is_bad_inode(inode)) >@@ -55,7 +55,7 @@ static int gfs2_drevalidate(struct dentr > if (sdp->sd_args.ar_localcaching) > goto valid; > >- had_lock = gfs2_glock_is_locked_by_me(dip->i_gl); >+ had_lock = (gfs2_glock_is_locked_by_me(dip->i_gl) != NULL); > if (!had_lock) { > error = gfs2_glock_nq_init(dip->i_gl, LM_ST_SHARED, 0, &d_gh); > if (error) >diff -urpN gfs2/ops_file.c gfs2-patched/ops_file.c >--- gfs2/ops_file.c 2008-03-16 01:32:06.000000000 -0500 >+++ gfs2-patched/ops_file.c 2008-03-16 01:30:07.000000000 -0500 >@@ -635,11 +635,100 @@ static int gfs2_flock(struct file *file, > return do_flock(file, cmd, fl); > } > >+static ssize_t gfs2_file_aio_read(struct kiocb *iocb, char __user *buf, >+ size_t count, loff_t pos) >+{ >+ ssize_t ret; >+ struct gfs2_inode *ip = GFS2_I(iocb->ki_filp->f_mapping->host); >+ struct gfs2_holder *gh; >+ >+ ret = generic_file_aio_read(iocb, buf, count, pos); >+ gh = gfs2_glock_is_locked_by_me(ip->i_gl); >+ if (gh) { >+ gfs2_glock_dq(gh); >+ gfs2_holder_uninit(gh); >+ kfree(gh); >+ } >+ return ret; >+} >+ >+static ssize_t gfs2_file_readv(struct file *filp, const struct iovec *iov, >+ unsigned long nr_segs, loff_t *ppos) >+{ >+ ssize_t ret; >+ struct gfs2_inode *ip = GFS2_I(filp->f_mapping->host); >+ struct gfs2_holder *gh; >+ >+ ret = generic_file_readv(filp, iov, nr_segs, ppos); >+ gh = gfs2_glock_is_locked_by_me(ip->i_gl); >+ if (gh) { >+ gfs2_glock_dq(gh); >+ gfs2_holder_uninit(gh); >+ kfree(gh); >+ } >+ return ret; >+} >+ >+static ssize_t gfs2_file_read(struct file *filp, char __user *buf, >+ size_t count, loff_t *ppos) >+ >+{ >+ ssize_t ret; >+ struct gfs2_inode *ip = GFS2_I(filp->f_mapping->host); >+ struct gfs2_holder *gh; >+ >+ ret = generic_file_read(filp, buf, count, ppos); >+ gh = gfs2_glock_is_locked_by_me(ip->i_gl); >+ if (gh) { >+ gfs2_glock_dq(gh); >+ gfs2_holder_uninit(gh); >+ kfree(gh); >+ } >+ return ret; >+} >+ >+static ssize_t gfs2_file_splice_read(struct file *filp, loff_t *ppos, >+ struct pipe_inode_info *pipe, size_t len, >+ unsigned int flags) >+ >+{ >+ ssize_t ret; >+ struct gfs2_inode *ip = GFS2_I(filp->f_mapping->host); >+ struct gfs2_holder *gh; >+ >+ ret = generic_file_splice_read(filp, ppos, pipe, len, flags); >+ gh = gfs2_glock_is_locked_by_me(ip->i_gl); >+ if (gh) { >+ gfs2_glock_dq(gh); >+ gfs2_holder_uninit(gh); >+ kfree(gh); >+ } >+ return ret; >+} >+ >+static ssize_t gfs2_file_splice_write(struct pipe_inode_info *pipe, >+ struct file *filp, loff_t *ppos, >+ size_t len, unsigned int flags) >+{ >+ ssize_t ret; >+ struct gfs2_inode *ip = GFS2_I(filp->f_mapping->host); >+ struct gfs2_holder *gh; >+ >+ ret = generic_file_splice_write(pipe, filp, ppos, len, flags); >+ gh = gfs2_glock_is_locked_by_me(ip->i_gl); >+ if (gh) { >+ gfs2_glock_dq(gh); >+ gfs2_holder_uninit(gh); >+ kfree(gh); >+ } >+ return ret; >+} >+ > const struct file_operations gfs2_file_fops = { > .llseek = gfs2_llseek, >- .read = generic_file_read, >- .readv = generic_file_readv, >- .aio_read = generic_file_aio_read, >+ .read = gfs2_file_read, >+ .readv = gfs2_file_readv, >+ .aio_read = gfs2_file_aio_read, > .write = generic_file_write, > .writev = generic_file_writev, > .aio_write = generic_file_aio_write, >@@ -651,8 +740,8 @@ const struct file_operations gfs2_file_f > .lock = gfs2_lock, > .sendfile = generic_file_sendfile, > .flock = gfs2_flock, >- .splice_read = generic_file_splice_read, >- .splice_write = generic_file_splice_write, >+ .splice_read = gfs2_file_splice_read, >+ .splice_write = gfs2_file_splice_write, > }; > > const struct file_operations gfs2_dir_fops = { >@@ -667,9 +756,9 @@ const struct file_operations gfs2_dir_fo > > const struct file_operations gfs2_file_fops_nolock = { > .llseek = gfs2_llseek, >- .read = generic_file_read, >- .readv = generic_file_readv, >- .aio_read = generic_file_aio_read, >+ .read = gfs2_file_read, >+ .readv = gfs2_file_readv, >+ .aio_read = gfs2_file_aio_read, > .write = generic_file_write, > .writev = generic_file_writev, > .aio_write = generic_file_aio_write, >@@ -679,8 +768,8 @@ const struct file_operations gfs2_file_f > .release = gfs2_close, > .fsync = gfs2_fsync, > .sendfile = generic_file_sendfile, >- .splice_read = generic_file_splice_read, >- .splice_write = generic_file_splice_write, >+ .splice_read = gfs2_file_splice_read, >+ .splice_write = gfs2_file_splice_write, > }; > > const struct file_operations gfs2_dir_fops_nolock = { >diff -urpN gfs2/ops_inode.c gfs2-patched/ops_inode.c >--- gfs2/ops_inode.c 2008-03-16 01:32:06.000000000 -0500 >+++ gfs2-patched/ops_inode.c 2008-03-14 10:10:22.000000000 -0500 >@@ -898,7 +898,7 @@ static int gfs2_permission(struct inode > int error; > int unlock = 0; > >- if (gfs2_glock_is_locked_by_me(ip->i_gl) == 0) { >+ if (gfs2_glock_is_locked_by_me(ip->i_gl) == NULL) { > error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh); > if (error) > return error; >@@ -1064,7 +1064,7 @@ static int gfs2_getattr(struct vfsmount > int error; > int unlock = 0; > >- if (gfs2_glock_is_locked_by_me(ip->i_gl) == 0) { >+ if (gfs2_glock_is_locked_by_me(ip->i_gl) == NULL) { > error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &gh); > if (error) > return error; >diff -urpN gfs2/ops_vm.c gfs2-patched/ops_vm.c >--- gfs2/ops_vm.c 2008-03-12 16:12:26.000000000 -0500 >+++ gfs2-patched/ops_vm.c 2008-03-14 10:51:38.000000000 -0500 >@@ -30,10 +30,19 @@ > static struct page *gfs2_private_nopage(struct vm_area_struct *area, > unsigned long address, int *type) > { >+ struct page *page; > struct gfs2_inode *ip = GFS2_I(area->vm_file->f_mapping->host); >+ struct gfs2_holder *gh; > > set_bit(GIF_PAGED, &ip->i_flags); >- return filemap_nopage(area, address, type); >+ page = filemap_nopage(area, address, type); >+ gh = gfs2_glock_is_locked_by_me(ip->i_gl); >+ if (gh) { >+ gfs2_glock_dq(gh); >+ gfs2_holder_uninit(gh); >+ kfree(gh); >+ } >+ return page; > } > > static int alloc_page_backing(struct gfs2_inode *ip, struct page *page)
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 432057
:
294383
|
295614
|
296569
|
297894
|
298191
|
302891
|
303203
|
303208
|
303209
|
303500
|
303542
|
303631
|
303637
|
303646
|
304026
|
304098
|
304112
|
304161
|
304398
|
304409
|
304572
|
304636
|
304637
|
304749
|
304755
|
304811
|
304837
|
304876
|
304898
|
304946
|
304955
|
304976
|
304984
|
305126
|
305185
|
305237
|
305266
|
305377
|
305387
|
305404
|
305506
|
305513
|
305678
|
305702
|
305727
|
306084
|
306111
|
306191
|
306207
|
306208
|
306275
|
306287
|
306832
|
306972
|
307077
|
307096
|
307158