From be51c024b6957047066b37d28a2977ef30ef8ba2 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 7 Jul 2011 21:17:29 +0000 Subject: [PATCH] Merged revisions 3656-3657 via svnmerge from https://vlnb@scst.svn.sourceforge.net/svnroot/scst/trunk ........ r3656 | bvassche | 2011-07-04 12:20:23 -0400 (Mon, 04 Jul 2011) | 1 line Add iscsi-scst/kernel/patches/rhel/put_page_callback_addendum-rhel6.patch ........ r3657 | bvassche | 2011-07-05 12:49:23 -0400 (Tue, 05 Jul 2011) | 1 line scst: Avoid that scst_pr_remove_device_files() causes a crash if pr_file_name == NULL or pr_file_name1 == NULL ........ git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.1.0.x@3667 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- .../rhel/put_page_callback_addendum-rhel6.patch | 11 +++++++++++ scst/src/scst_pres.c | 12 ++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 iscsi-scst/kernel/patches/rhel/put_page_callback_addendum-rhel6.patch diff --git a/iscsi-scst/kernel/patches/rhel/put_page_callback_addendum-rhel6.patch b/iscsi-scst/kernel/patches/rhel/put_page_callback_addendum-rhel6.patch new file mode 100644 index 000000000..38a0896ed --- /dev/null +++ b/iscsi-scst/kernel/patches/rhel/put_page_callback_addendum-rhel6.patch @@ -0,0 +1,11 @@ +diff -upkr linux-2.6.32.x86_64/include/linux/Kbuild linux-2.6.32.x86_64/include/linux/Kbuild +--- linux-2.6.32.x86_64/include/linux/Kbuild 2009-12-03 04:51:21.000000000 +0100 ++++ linux-2.6.32.x86_64/include/linux/Kbuild 2010-08-27 13:14:53.767830262 +0200 +@@ -112,6 +112,7 @@ header-y += map_to_7segment.h + header-y += matroxfb.h + header-y += meye.h + header-y += minix_fs.h ++header-y += mm.h + header-y += mmtimer.h + header-y += mqueue.h + header-y += mtio.h diff --git a/scst/src/scst_pres.c b/scst/src/scst_pres.c index 0ca4c92ba..689ffa691 100644 --- a/scst/src/scst_pres.c +++ b/scst/src/scst_pres.c @@ -928,28 +928,32 @@ static void scst_pr_remove_device_files(struct scst_tgt_dev *tgt_dev) set_fs(KERNEL_DS); #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39) - res = path_lookup(dev->pr_file_name, 0, &nd); + res = dev->pr_file_name ? path_lookup(dev->pr_file_name, 0, &nd) : + -ENOENT; if (!res) scst_pr_vfs_unlink_and_put(&nd); else TRACE_DBG("Unable to lookup file '%s' - error %d", dev->pr_file_name, res); - res = path_lookup(dev->pr_file_name1, 0, &nd); + res = dev->pr_file_name1 ? path_lookup(dev->pr_file_name1, 0, &nd) : + -ENOENT; if (!res) scst_pr_vfs_unlink_and_put(&nd); else TRACE_DBG("Unable to lookup file '%s' - error %d", dev->pr_file_name1, res); #else - res = kern_path(dev->pr_file_name, 0, &path); + res = dev->pr_file_name ? kern_path(dev->pr_file_name, 0, &path) : + -ENOENT; if (!res) scst_pr_vfs_unlink_and_put(&path); else TRACE_DBG("Unable to lookup file '%s' - error %d", dev->pr_file_name, res); - res = kern_path(dev->pr_file_name1, 0, &path); + res = dev->pr_file_name1 ? kern_path(dev->pr_file_name1, 0, &path) : + -ENOENT; if (!res) scst_pr_vfs_unlink_and_put(&path); else