From 9448f0d4361a7f488ab3b8b380aad63dd97fb1be Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Mon, 20 Jul 2009 10:34:54 +0000 Subject: [PATCH] Fixes incorrect errors reporting on devices unregistration. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@964 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- doc/scst_user_spec.txt | 3 ++- scst/src/dev_handlers/scst_user.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/scst_user_spec.txt b/doc/scst_user_spec.txt index beb789482..bb90a0477 100644 --- a/doc/scst_user_spec.txt +++ b/doc/scst_user_spec.txt @@ -105,7 +105,8 @@ space device. It doesn't have any parameters. During execution of SCST_USER_UNREGISTER_DEVICE at least one another thread must process all coming subcommands, otherwise after timeout it -will fail with EBUSY error. +will fail with EBUSY error. The processing should stop on receiving +ENODEV error. SCST_USER_UNREGISTER_DEVICE returns 0 on success or -1 in case of error, and errno is set appropriately. diff --git a/scst/src/dev_handlers/scst_user.c b/scst/src/dev_handlers/scst_user.c index 3b325f9e5..c39d9c2e5 100644 --- a/scst/src/dev_handlers/scst_user.c +++ b/scst/src/dev_handlers/scst_user.c @@ -266,7 +266,7 @@ static inline int calc_num_pg(unsigned long buf, int len) static void __dev_user_not_reg(void) { - PRINT_ERROR("%s", "Device not registered"); + TRACE(TRACE_MGMT_MINOR, "%s", "Device not registered"); return; } @@ -274,7 +274,7 @@ static inline int dev_user_check_reg(struct scst_user_dev *dev) { if (dev == NULL) { __dev_user_not_reg(); - return -EINVAL; + return -ENODEV; } return 0; }