From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pete Zaitcev Subject: [Patch] cld: return more correct codes Date: Thu, 27 Aug 2009 12:54:07 -0600 Message-ID: <20090827125407.3a810c48@redhat.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: Sender: hail-devel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" To: Jeff Garzik Cc: Project Hail List When doing "ls /foo" in cldcli currently, server reports "invalid inode number". But in fact it's a name that's incorrect, all numbers are fine. It seems we need to return "invalid name" afer we looked up by name, and "invalid number" after we looked up by number (this is ok now and not changed by the patch). Signed-off-by: Pete Zaitcev diff --git a/server/msg.c b/server/msg.c index 6666d3c..4ac806e 100644 --- a/server/msg.c +++ b/server/msg.c @@ -583,7 +583,7 @@ void msg_open(struct msg_params *mp) goto err_out; } if (!create && (rc == DB_NOTFOUND)) { - resp_rc = CLE_INODE_INVAL; + resp_rc = CLE_NAME_INVAL; goto err_out; } if (create && rc == 0) { @@ -990,7 +990,7 @@ void msg_del(struct msg_params *mp) rc = cldb_inode_get_byname(txn, name, name_len, &ino, false, 0); if (rc) { if (rc == DB_NOTFOUND) - resp_rc = CLE_INODE_INVAL; + resp_rc = CLE_NAME_INVAL; else resp_rc = CLE_DB_ERR; goto err_out;