Re: [PATCH] max_loop limit

Ken Chen
2007-03-25T00:29:47Z

On 3/23/07, Jan Engelhardt <jengelh@linux01.gwdg.de> wrote:
> @@ -1383,7 +1380,7 @@ int loop_unregister_transfer(int number)
>
> xfer_funcs[n] = NULL;
>
> - for (lo = &loop_dev[0]; lo < &loop_dev[max_loop]; lo++) {
> + list_for_each_entry(lo, &loop_devices, lo_list) {
> mutex_lock(&lo->lo_ctl_mutex);

Don't you need to use loop_devices_lock to protect the linked list here?

> +static struct loop_device *loop_find_dev(unsigned int number)
> +{
> + struct loop_device *lo;
> + list_for_each_entry(lo, &loop_devices, lo_list)
> + if (lo->lo_number == number)
> + return lo;
> + return NULL;

Here too with spin lock??