aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Seebach <peter.seebach@windriver.com>2015-08-22 16:08:08 -0500
committerPeter Seebach <peter.seebach@windriver.com>2015-08-24 12:02:10 -0500
commitcee6afd78a99c56fdb51821eb9727e1ccd07da4a (patch)
tree449aa8df179d86f6836b60d719c35017a5e3c4af
parent5de87663775e46aed24b15a894491413513a5d92 (diff)
downloadpseudo-cee6afd78a99c56fdb51821eb9727e1ccd07da4a.tar.gz
pseudo-cee6afd78a99c56fdb51821eb9727e1ccd07da4a.tar.bz2
pseudo-cee6afd78a99c56fdb51821eb9727e1ccd07da4a.zip
Some extra debugging bits.
Add some debug messages useful for tracking down xattr behaviors. Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
-rw-r--r--ChangeLog.txt1
-rw-r--r--pseudo.c15
-rw-r--r--pseudo_client.c7
3 files changed, 20 insertions, 3 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt
index 8f2afed..8681eaf 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -2,6 +2,7 @@
* (seebs) Prevent files from getting created with real filesystem
mode 0, even with umask.
* (seebs) xattrdb logic fixes.
+ * (seebs) Debugging messages.
2015-08-21:
* (seebs) don't put incorrect host UIDs in dummy entries in db.
diff --git a/pseudo.c b/pseudo.c
index 6c5360b..42aa64e 100644
--- a/pseudo.c
+++ b/pseudo.c
@@ -824,6 +824,8 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon
pdb_unlink_file_dev(&by_ino);
}
if (!found_path) {
+ pseudo_debug(PDBGF_DB, "linking %s for OP_CREAT\n",
+ msg->pathlen ? msg->path : "no path");
pdb_link_file(msg, NULL);
} else {
/* again, an error, but leaving it alone for now. */
@@ -857,6 +859,8 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon
*/
if (!found_path && !found_ino) {
pseudo_debug(PDBGF_FILE, "(new) ");
+ pseudo_debug(PDBGF_DB, "linking %s for OP_[F]CHMOD\n",
+ msg->pathlen ? msg->path : "no path");
pdb_link_file(msg, NULL);
}
break;
@@ -887,6 +891,8 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon
*/
if (!found_path && !found_ino) {
pseudo_debug(PDBGF_FILE, "(new) ");
+ pseudo_debug(PDBGF_DB, "linking %s for OP_[F]CHOWN\n",
+ msg->pathlen ? msg->path : "no path");
pdb_link_file(msg, NULL);
}
break;
@@ -954,6 +960,9 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon
} else {
*msg = msg_header;
}
+ pseudo_debug(PDBGF_DB, "linking %s for %s\n",
+ msg->pathlen ? msg->path : "no path",
+ pseudo_op_name(msg->op));
pdb_link_file(msg, NULL);
break;
case OP_RENAME:
@@ -1016,6 +1025,9 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon
pdb_unlink_file_dev(&by_ino);
}
*msg = msg_header;
+ pseudo_debug(PDBGF_DB, "linking %s for %s\n",
+ msg->pathlen ? msg->path : "no path",
+ pseudo_op_name(msg->op));
pdb_link_file(msg, NULL);
break;
case OP_GET_XATTR:
@@ -1056,6 +1068,9 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon
msg->uid = (uid_t) -1;
msg->gid = (gid_t) -1;
#endif
+ pseudo_debug(PDBGF_DB, "linking %s (uid -1 if xattr) for %s\n",
+ msg->pathlen ? msg->path : "no path",
+ pseudo_op_name(msg->op));
pdb_link_file(msg, &row);
}
if (pdb_set_xattr(row, oldpath, oldpathlen, xattr_flags)) {
diff --git a/pseudo_client.c b/pseudo_client.c
index bccd3e1..4eb91df 100644
--- a/pseudo_client.c
+++ b/pseudo_client.c
@@ -279,12 +279,14 @@ pseudo_xattrdb_load(int fd, const char *path, const struct stat64 *buf) {
retryrc = pseudo_real_fsetxattr(fd, "user.pseudo_data", &pseudo_db_data, sizeof(pseudo_db_data), 0);
}
}
- pseudo_debug(PDBGF_XATTRDB, "tried to load data for %s/%d: rc %d, version %d.\n",
+ pseudo_debug(PDBGF_XATTRDB, "tried to load data for %s[%d]: rc %d, version %d.\n",
path ? path : "<nil>", fd, rc, pseudo_db_data.version);
if (rc == -1 && retryrc == 0) {
/* there's no data, but there could have been; treat
* this as an empty database result.
*/
+ pseudo_debug(PDBGF_XATTRDB, "wrote version 0 for %s[%d]\n",
+ path ? path : "<nil>", fd);
xattrdb_data.result = RESULT_FAIL;
return &xattrdb_data;
} else if (rc == -1) {
@@ -1815,8 +1817,7 @@ pseudo_client_op(pseudo_op_t op, int access, int fd, int dirfd, const char *path
}
#ifdef PSEUDO_XATTRDB
else {
- pseudo_debug(PDBGF_OP, "(%d) (handled through xattrdb)", getpid());
- pseudo_debug(PDBGF_OP, "result: %d\n", result->result);
+ pseudo_debug(PDBGF_OP, "(%d) (handled through xattrdb: %s)", getpid(), pseudo_res_name(result->result));
}
#endif
pseudo_debug(PDBGF_OP, "\n");