All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pete Zaitcev <zaitcev@redhat.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: Project Hail List <hail-devel@vger.kernel.org>
Subject: [Patch] cld: return more correct codes
Date: Thu, 27 Aug 2009 12:54:07 -0600	[thread overview]
Message-ID: <20090827125407.3a810c48@redhat.com> (raw)

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 <zaitcev@redhat.com>

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;

             reply	other threads:[~2009-08-27 18:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-27 18:54 Pete Zaitcev [this message]
2009-08-27 19:39 ` [Patch] cld: return more correct codes Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090827125407.3a810c48@redhat.com \
    --to=zaitcev@redhat.com \
    --cc=hail-devel@vger.kernel.org \
    --cc=jeff@garzik.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.