aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/dlm/dlmmaster.c
diff options
context:
space:
mode:
authorMark Fasheh <mark.fasheh@oracle.com>2006-09-08 14:38:29 -0400
committerMark Fasheh <mark.fasheh@oracle.com>2006-09-24 16:50:42 -0400
commit3384f3df5ed939a25135e1b2734fb7cdee1720a8 (patch)
tree7a68180b6adeb74b5a0a96e6c2d4ad529b34096d /fs/ocfs2/dlm/dlmmaster.c
parente2c73698af3dac89328eef2b55f6746e0507d2bc (diff)
ocfs2: Allow binary names in the DLM
The OCFS2 DLM uses strlen() to determine lock name length, which excludes the possibility of putting binary values in the name string. Fix this by requiring that string length be passed in as a parameter. Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/dlm/dlmmaster.c')
-rw-r--r--fs/ocfs2/dlm/dlmmaster.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
index 9503240ef0e5..f784177b6241 100644
--- a/fs/ocfs2/dlm/dlmmaster.c
+++ b/fs/ocfs2/dlm/dlmmaster.c
@@ -740,6 +740,7 @@ struct dlm_lock_resource *dlm_new_lockres(struct dlm_ctxt *dlm,
740 */ 740 */
741struct dlm_lock_resource * dlm_get_lock_resource(struct dlm_ctxt *dlm, 741struct dlm_lock_resource * dlm_get_lock_resource(struct dlm_ctxt *dlm,
742 const char *lockid, 742 const char *lockid,
743 int namelen,
743 int flags) 744 int flags)
744{ 745{
745 struct dlm_lock_resource *tmpres=NULL, *res=NULL; 746 struct dlm_lock_resource *tmpres=NULL, *res=NULL;
@@ -748,13 +749,12 @@ struct dlm_lock_resource * dlm_get_lock_resource(struct dlm_ctxt *dlm,
748 int blocked = 0; 749 int blocked = 0;
749 int ret, nodenum; 750 int ret, nodenum;
750 struct dlm_node_iter iter; 751 struct dlm_node_iter iter;
751 unsigned int namelen, hash; 752 unsigned int hash;
752 int tries = 0; 753 int tries = 0;
753 int bit, wait_on_recovery = 0; 754 int bit, wait_on_recovery = 0;
754 755
755 BUG_ON(!lockid); 756 BUG_ON(!lockid);
756 757
757 namelen = strlen(lockid);
758 hash = dlm_lockid_hash(lockid, namelen); 758 hash = dlm_lockid_hash(lockid, namelen);
759 759
760 mlog(0, "get lockres %s (len %d)\n", lockid, namelen); 760 mlog(0, "get lockres %s (len %d)\n", lockid, namelen);