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 153037 Details for
Bug 237126
invalid ids for user locks
[?]
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 posted to rhkernel on 04/19
dlm-lkid-format.patch (text/plain), 2.00 KB, created by
David Teigland
on 2007-04-19 17:36:50 UTC
(
hide
)
Description:
patch posted to rhkernel on 04/19
Filename:
MIME Type:
Creator:
David Teigland
Created:
2007-04-19 17:36:50 UTC
Size:
2.00 KB
patch
obsolete
>[PATCH] dlm: change lkid format > >bz 237126 > >A lock id is a uint32 and is used as an opaque reference to the lock. For >userland apps, the lkid is passed up, through libdlm, as the return value >from a write() on the dlm device. This created a problem when the high >bit was 1, making the lkid look like an error. This is fixed by changing >how the lkid is composed. The low 16 bits identified the hash bucket for >the lock and the high 16 bits were a per-bucket counter (which eventually >hit 0x8000 causing the problem). These are simply swapped around; the >number of hash table buckets is far below 0x8000, making all lkid's >positive when viewed as signed. > >Index: linux-2.6.21-rc5-quilt/fs/dlm/lock.c >=================================================================== >--- linux-2.6.21-rc5-quilt.orig/fs/dlm/lock.c 2007-04-02 11:01:12.000000000 -0500 >+++ linux-2.6.21-rc5-quilt/fs/dlm/lock.c 2007-04-02 11:10:32.000000000 -0500 >@@ -580,7 +580,7 @@ > /* counter can roll over so we must verify lkid is not in use */ > > while (lkid == 0) { >- lkid = bucket | (ls->ls_lkbtbl[bucket].counter++ << 16); >+ lkid = (bucket << 16) | ls->ls_lkbtbl[bucket].counter++; > > list_for_each_entry(tmp, &ls->ls_lkbtbl[bucket].list, > lkb_idtbl_list) { >@@ -601,8 +601,8 @@ > > static struct dlm_lkb *__find_lkb(struct dlm_ls *ls, uint32_t lkid) > { >- uint16_t bucket = lkid & 0xFFFF; > struct dlm_lkb *lkb; >+ uint16_t bucket = (lkid >> 16); > > list_for_each_entry(lkb, &ls->ls_lkbtbl[bucket].list, lkb_idtbl_list) { > if (lkb->lkb_id == lkid) >@@ -614,7 +614,7 @@ > static int find_lkb(struct dlm_ls *ls, uint32_t lkid, struct dlm_lkb **lkb_ret) > { > struct dlm_lkb *lkb; >- uint16_t bucket = lkid & 0xFFFF; >+ uint16_t bucket = (lkid >> 16); > > if (bucket >= ls->ls_lkbtbl_size) > return -EBADSLT; >@@ -644,7 +644,7 @@ > > static int __put_lkb(struct dlm_ls *ls, struct dlm_lkb *lkb) > { >- uint16_t bucket = lkb->lkb_id & 0xFFFF; >+ uint16_t bucket = (lkb->lkb_id >> 16); > > write_lock(&ls->ls_lkbtbl[bucket].lock); > if (kref_put(&lkb->lkb_ref, kill_lkb)) {
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 237126
: 153037