[openib-general] [PATCH] mthca: check for illegal acl when registering an mr

Jack Morgenstein jackm at mellanox.co.il
Sun Oct 2 06:25:52 PDT 2005


Now check in kernel space for illegal combination of acl parameters
(per IB Spec 11.2.8.2).

Signed-off-by: Jack Morgenstein <jackm at mellanox.co.il>

Index: linux-kernel/infiniband/hw/mthca/mthca_provider.c
===================================================================
--- linux-kernel/infiniband/hw/mthca/mthca_provider.c	(revision 3632)
+++ linux-kernel/infiniband/hw/mthca/mthca_provider.c	(working copy)
@@ -860,6 +860,10 @@
 	int i, j, k;
 	int err = 0;
 
+	if (acc & (IB_ACCESS_REMOTE_ATOMIC | IB_ACCESS_REMOTE_WRITE) && 
+	    !(acc & IB_ACCESS_LOCAL_WRITE))
+		return ERR_PTR(-EINVAL);
+
 	shift = ffs(region->page_size) - 1;
 
 	mr = kmalloc(sizeof *mr, GFP_KERNEL);



More information about the general mailing list