The patch titled uml ubd driver: change ubd_lock to be a mutex has been added to the -mm tree. Its filename is uml-ubd-driver-change-ubd_lock-to-be-a-mutex.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: uml ubd driver: change ubd_lock to be a mutex From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@xxxxxxxx> This lock protects ubd setup and teardown, so is only used in process context; beyond that, during such setup memory allocations must be performed and some generic functions which can sleep must be called (such as add_disk()). So the only correct solution is to make it a mutex instead of a spin_lock. No other change is done - this lock must be acquired in different places but it's done afterwards. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@xxxxxxxx> Cc: Jeff Dike <jdike@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- arch/um/drivers/ubd_kern.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff -puN arch/um/drivers/ubd_kern.c~uml-ubd-driver-change-ubd_lock-to-be-a-mutex arch/um/drivers/ubd_kern.c --- a/arch/um/drivers/ubd_kern.c~uml-ubd-driver-change-ubd_lock-to-be-a-mutex +++ a/arch/um/drivers/ubd_kern.c @@ -107,7 +107,8 @@ static inline void ubd_set_bit(__u64 bit #define DRIVER_NAME "uml-blkdev" static DEFINE_SPINLOCK(ubd_io_lock); -static DEFINE_SPINLOCK(ubd_lock); + +static DEFINE_MUTEX(ubd_lock); static void (*do_ubd)(void); @@ -314,7 +315,7 @@ static int ubd_setup_common(char *str, i } err = 1; - spin_lock(&ubd_lock); + mutex_lock(&ubd_lock); if(fake_major != MAJOR_NR){ printk(KERN_ERR "Can't assign a fake major twice\n"); goto out1; @@ -326,7 +327,7 @@ static int ubd_setup_common(char *str, i major); err = 0; out1: - spin_unlock(&ubd_lock); + mutex_unlock(&ubd_lock); return(err); } @@ -343,7 +344,7 @@ static int ubd_setup_common(char *str, i } err = 1; - spin_lock(&ubd_lock); + mutex_lock(&ubd_lock); ubd_dev = &ubd_devs[n]; if(ubd_dev->file != NULL){ @@ -405,7 +406,7 @@ break_loop: ubd_dev->cow.file = backing_file; ubd_dev->boot_openflags = flags; out: - spin_unlock(&ubd_lock); + mutex_unlock(&ubd_lock); return(err); } @@ -710,11 +711,11 @@ static int ubd_config(char *str) } if(n == -1) return(0); - spin_lock(&ubd_lock); + mutex_lock(&ubd_lock); err = ubd_add(n); if(err) ubd_devs[n].file = NULL; - spin_unlock(&ubd_lock); + mutex_unlock(&ubd_lock); return(err); } @@ -731,7 +732,7 @@ static int ubd_get_config(char *name, ch } ubd_dev = &ubd_devs[n]; - spin_lock(&ubd_lock); + mutex_lock(&ubd_lock); if(ubd_dev->file == NULL){ CONFIG_CHUNK(str, size, len, "", 1); @@ -747,7 +748,7 @@ static int ubd_get_config(char *name, ch else CONFIG_CHUNK(str, size, len, "", 1); out: - spin_unlock(&ubd_lock); + mutex_unlock(&ubd_lock); return(len); } @@ -766,7 +767,7 @@ static int ubd_remove(int n) struct ubd *ubd_dev; int err = -ENODEV; - spin_lock(&ubd_lock); + mutex_lock(&ubd_lock); if(ubd_gendisk[n] == NULL) goto out; @@ -795,7 +796,7 @@ static int ubd_remove(int n) *ubd_dev = ((struct ubd) DEFAULT_UBD); err = 0; out: - spin_unlock(&ubd_lock); + mutex_unlock(&ubd_lock); return err; } _ Patches currently in -mm which might be from blaisorblade@xxxxxxxx are fix-remove-the-use-of-_syscallx-macros-in-uml.patch uml-fix-compilation-options-for-user_objs.patch uml-ubd-driver-allow-using-up-to-16-ubd-devices.patch uml-ubd-driver-document-some-struct-fields.patch uml-ubd-driver-var-renames.patch uml-ubd-driver-give-better-names-to-some-functions.patch uml-ubd-driver-change-ubd_lock-to-be-a-mutex.patch uml-ubd-driver-ubd_io_lock-usage-fixup.patch uml-ubd-driver-reformat-ubd_config.patch uml-ubd-driver-convert-do_ubd-to-a-boolean-variable.patch uml-ubd-driver-use-bitfields-where-possible.patch uml-ubd-driver-do-not-store-error-codes-as-fd.patch uml-ubd-driver-various-little-changes.patch uml-fix-prototypes.patch uml-make-execvp-safe-for-our-usage.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html