[openib-general] ucm: 2.6.17 GIT vs openib trunk issues in file ucm.c

Jack Morgenstein jackm at mellanox.co.il
Thu May 25 00:33:23 PDT 2006


Hi,

Two questions:

1. I notice that in the GIT version of core/ucm.c, the trunk updates below 
were not taken into the 2.6.17 GIT.  Is there a reason?
------------------------------------------------------------------------
r5643 | sean.hefty | 2006-03-07 02:09:48 +0200 (Tue, 07 Mar 2006) | 4 lines
Changed paths:
   M /gen2/trunk/src/linux-kernel/infiniband/core/ucm.c

Convert file mutex from a semaphore to a real mutex for 2.6.16.

Signed-off-by: Sean Hefty <sean.hefty at intel.com>

------------------------------------------------------------------------
------------------------------------------------------------------------
r5944 | roland | 2006-03-22 03:02:22 +0200 (Wed, 22 Mar 2006) | 4 lines
Changed paths:
   M /gen2/trunk/src/linux-kernel/infiniband/core/ucm.c

file_mutex is really a struct mutex, so use mutex_init() instead of 
init_MUTEX().

Signed-off-by: Roland Dreier <rolandd at cisco.com>

------------------------------------------------------------------------


2. Missing mutex protection in ucm.c for list_empty call.  Is there a reason?

GIT: 
static unsigned int ib_ucm_poll(struct file *filp,
				struct poll_table_struct *wait)
{
	struct ib_ucm_file *file = filp->private_data;
	unsigned int mask = 0;

	poll_wait(filp, &file->poll_wait, wait);

	if (!list_empty(&file->events))
		mask = POLLIN | POLLRDNORM;

	return mask;
}

Trunk:
static unsigned int ib_ucm_poll(struct file *filp,
				struct poll_table_struct *wait)
{
	struct ib_ucm_file *file = filp->private_data;
	unsigned int mask = 0;

	poll_wait(filp, &file->poll_wait, wait);

	mutex_lock(&file->file_mutex);
	if (!list_empty(&file->events))
		mask = POLLIN | POLLRDNORM;
	mutex_unlock(&file->file_mutex);

	return mask;
}



More information about the general mailing list