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 153444 Details for
Bug 234086
dlm locking error from gfs dio/aio during virt machine migration
[?]
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.
same change as above, but the patch applies against the 5.0 kernel
dlm-fix-alt-modes.patch (text/plain), 4.91 KB, created by
David Teigland
on 2007-04-25 19:24:49 UTC
(
hide
)
Description:
same change as above, but the patch applies against the 5.0 kernel
Filename:
MIME Type:
Creator:
David Teigland
Created:
2007-04-25 19:24:49 UTC
Size:
4.91 KB
patch
obsolete
>[PATCH] dlm: fix mode munging > >bz 234086 > >There are flags to enable two specialized features in the dlm: > >1. CONVDEADLK causes the dlm to resolve conversion deadlocks internally by > changing the granted mode of locks to NL. >2. ALTPR/ALTCW cause the dlm to change the requested mode of locks to PR > or CW to grant them if the main mode can't be granted. > >GFS direct i/o exercises both of these features, especially when mixed >with buffered i/o. The dlm has problems with them. > >The first problem is on the master node. If it demotes a lock as a part of >converting it, the actual step of converting the lock isn't being done >after the demotion, the lock is just left sitting on the granted queue >with a granted mode of NL. I think the mistaken assumption was that the call >to grant_pending_locks() would grant it, but that function naturally doesn't >look at locks on the granted queue. > >The second problem is on the process node. If the master either demotes >or gives an altmode, the munging of the gr/rq modes is never done in the >process copy of the lock, leaving the master/process copies out of sync. > >Index: linux-rhel50-quilt/fs/dlm/lock.c >=================================================================== >--- linux-rhel50-quilt.orig/fs/dlm/lock.c 2007-04-19 12:52:34.000000000 -0500 >+++ linux-rhel50-quilt/fs/dlm/lock.c 2007-04-19 12:54:22.000000000 -0500 >@@ -223,6 +223,16 @@ > return (lkb->lkb_sbflags & DLM_SBF_DEMOTED); > } > >+static inline int is_altmode(struct dlm_lkb *lkb) >+{ >+ return (lkb->lkb_sbflags & DLM_SBF_ALTMODE); >+} >+ >+static inline int is_granted(struct dlm_lkb *lkb) >+{ >+ return (lkb->lkb_status == DLM_LKSTS_GRANTED); >+} >+ > static inline int is_remote(struct dlm_rsb *r) > { > DLM_ASSERT(r->res_nodeid >= 0, dlm_print_rsb(r);); >@@ -1049,6 +1059,50 @@ > queue_cast(r, lkb, 0); > } > >+/* The special CONVDEADLK, ALTPR and ALTCW flags allow the master to >+ change the granted/requested modes. We're munging things accordingly in >+ the process copy. >+ CONVDEADLK: our grmode may have been forced down to NL to resolve a >+ conversion deadlock >+ ALTPR/ALTCW: our rqmode may have been changed to PR or CW to become >+ compatible with other granted locks */ >+ >+static void munge_demoted(struct dlm_lkb *lkb, struct dlm_message *ms) >+{ >+ if (ms->m_type != DLM_MSG_CONVERT_REPLY) { >+ log_print("munge_demoted %x invalid reply type %d", >+ lkb->lkb_id, ms->m_type); >+ return; >+ } >+ >+ if (lkb->lkb_rqmode == DLM_LOCK_IV || lkb->lkb_grmode == DLM_LOCK_IV) { >+ log_print("munge_demoted %x invalid modes gr %d rq %d", >+ lkb->lkb_id, lkb->lkb_grmode, lkb->lkb_rqmode); >+ return; >+ } >+ >+ lkb->lkb_grmode = DLM_LOCK_NL; >+} >+ >+static void munge_altmode(struct dlm_lkb *lkb, struct dlm_message *ms) >+{ >+ if (ms->m_type != DLM_MSG_REQUEST_REPLY && >+ ms->m_type != DLM_MSG_GRANT) { >+ log_print("munge_altmode %x invalid reply type %d", >+ lkb->lkb_id, ms->m_type); >+ return; >+ } >+ >+ if (lkb->lkb_exflags & DLM_LKF_ALTPR) >+ lkb->lkb_rqmode = DLM_LOCK_PR; >+ else if (lkb->lkb_exflags & DLM_LKF_ALTCW) >+ lkb->lkb_rqmode = DLM_LOCK_CW; >+ else { >+ log_print("munge_altmode invalid exflags %x", lkb->lkb_exflags); >+ dlm_print_lkb(lkb); >+ } >+} >+ > static inline int first_in_list(struct dlm_lkb *lkb, struct list_head *head) > { > struct dlm_lkb *first = list_entry(head->next, struct dlm_lkb, >@@ -1726,9 +1780,24 @@ > goto out; > } > >- if (can_be_queued(lkb)) { >- if (is_demoted(lkb)) >+ /* is_demoted() means the can_be_granted() above set the grmode >+ to NL, and left us on the granted queue. This auto-demotion >+ (due to CONVDEADLK) might mean other locks, and/or this lock, are >+ now grantable. We have to try to grant other converting locks >+ before we try again to grant this one. */ >+ >+ if (is_demoted(lkb)) { >+ grant_pending_convert(r, DLM_LOCK_IV); >+ if (_can_be_granted(r, lkb, 1)) { >+ grant_lock(r, lkb); >+ queue_cast(r, lkb, 0); > grant_pending_locks(r); >+ goto out; >+ } >+ /* else fall through and move to convert queue */ >+ } >+ >+ if (can_be_queued(lkb)) { > error = -EINPROGRESS; > del_lkb(r, lkb); > add_lkb(r, lkb, DLM_LKSTS_CONVERT); >@@ -2650,6 +2719,8 @@ > lock_rsb(r); > > receive_flags_reply(lkb, ms); >+ if (is_altmode(lkb)) >+ munge_altmode(lkb, ms); > grant_lock_pc(r, lkb, ms); > queue_cast(r, lkb, 0); > >@@ -2779,6 +2850,8 @@ > /* request was queued or granted on remote master */ > receive_flags_reply(lkb, ms); > lkb->lkb_remid = ms->m_lkid; >+ if (is_altmode(lkb)) >+ munge_altmode(lkb, ms); > if (error) > add_lkb(r, lkb, DLM_LKSTS_WAITING); > else { >@@ -2821,6 +2894,9 @@ > > case -EINPROGRESS: > /* convert was queued on remote master */ >+ receive_flags_reply(lkb, ms); >+ if (is_demoted(lkb)) >+ munge_demoted(lkb, ms); > del_lkb(r, lkb); > add_lkb(r, lkb, DLM_LKSTS_CONVERT); > break; >@@ -2828,6 +2904,8 @@ > case 0: > /* convert was granted on remote master */ > receive_flags_reply(lkb, ms); >+ if (is_demoted(lkb)) >+ munge_demoted(lkb, ms); > grant_lock_pc(r, lkb, ms); > queue_cast(r, lkb, 0); > break;
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 Raw
Actions:
View
Attachments on
bug 234086
:
153038
| 153444