Hi Alasdair, Thank you for the comments. Alasdair G Kergon wrote: > Make sure you test this properly under low memory situations. OK. > dm_swap_table() mustn't block waiting for memory to become > free (except in a controlled way e.g. with a mempool, but > it would need more than that here). > > Here, dm_swap_table() leads to kmalloc() getting called > in sysfs_add_link(). I moved the sysfs_add_link() to the last part of dm_resume(). Directory creation/deletion are also moved in the alloc_dev/ free_dev function as kobject_register/unregister may allocate memory. I didn't change the part of removing symlink as it doesn't allocate memory. Do you think this is an acceptable approach? -- Jun'ichi Nomura, NEC Solutions (America), Inc.