if (*p)
goto out;
- if (pool_ns)
- boutc(cl, "pool %lld ns %.*s no perm cached\n", pool,
- (int)pool_ns->len, pool_ns->str);
- else
+ if (pool_ns) {
+ char result_str[128];
+ CEPH_SAN_STRNCPY(result_str, sizeof(result_str), pool_ns->str, (int)pool_ns->len);
+ boutc(cl, "pool %lld ns %s no perm cached\n", pool,
+ result_str);
+ } else
boutc(cl, "pool %lld no perm cached\n", pool);
down_write(&mdsc->pool_perm_rwsem);
out:
if (!err)
err = have;
- if (pool_ns)
- boutc(cl, "pool %lld ns %.*s result = %d\n", pool,
- (int)pool_ns->len, pool_ns->str, err);
- else
+ if (pool_ns) {
+ char result_str[128];
+ CEPH_SAN_STRNCPY(result_str, sizeof(result_str), pool_ns->str, (int)pool_ns->len);
+ boutc(cl, "pool %lld ns %s result = %d\n", pool,
+ result_str, err);
+ } else
boutc(cl, "pool %lld result = %d\n", pool, err);
return err;
}
}
for (; i < rinfo->dir_nr; i++) {
struct ceph_mds_reply_dir_entry *rde = rinfo->dir_entries + i;
+ char result_str[128];
if (rde->offset < ctx->pos) {
pr_warn_client(cl,
return -EIO;
ctx->pos = rde->offset;
- boutc(cl, "%p %llx.%llx (%d/%d) -> %llx '%.*s' %p\n", inode,
+ CEPH_SAN_STRNCPY(result_str, sizeof(result_str), rde->name, rde->name_len);
+ boutc(cl, "%p %llx.%llx (%d/%d) -> %llx '%s' %p\n", inode,
ceph_vinop(inode), i, rinfo->dir_nr, ctx->pos,
- rde->name_len, rde->name, &rde->inode.in);
+ result_str, &rde->inode.in);
if (!dir_emit(ctx, rde->name, rde->name_len,
ceph_present_ino(inode->i_sb, le64_to_cpu(rde->inode.in->ino)),
if (dir && req->r_op == CEPH_MDS_OP_LOOKUPNAME &&
test_bit(CEPH_MDS_R_PARENT_LOCKED, &req->r_req_flags) &&
!test_bit(CEPH_MDS_R_ABORTED, &req->r_req_flags)) {
+ char result_str[128];
bool is_nokey = false;
struct qstr dname;
struct dentry *dn, *parent;
tvino.ino = le64_to_cpu(rinfo->targeti.in->ino);
tvino.snap = le64_to_cpu(rinfo->targeti.in->snapid);
retry_lookup:
+ CEPH_SAN_STRNCPY(result_str, sizeof(result_str), dname.name, dname.len);
dn = d_lookup(parent, &dname);
- boutc(cl, "d_lookup on parent=%p name=%.*s got %p\n",
- parent, dname.len, dname.name, dn);
+ boutc(cl, "d_lookup on parent=%p name=%s got %p\n",
+ parent, result_str, dn);
if (!dn) {
dn = d_alloc(parent, &dname);
- boutc(cl, "d_alloc %p '%.*s' = %p\n", parent,
- dname.len, dname.name, dn);
+ boutc(cl, "d_alloc %p '%s' = %p\n", parent,
+ result_str, dn);
if (!dn) {
dput(parent);
ceph_fname_free_buffer(dir, &oname);
for (i = 0; i < rinfo->dir_nr; i++) {
struct ceph_mds_reply_dir_entry *rde = rinfo->dir_entries + i;
struct ceph_vino tvino;
+ char result_str[128];
dname.name = rde->name;
dname.len = rde->name_len;
retry_lookup:
dn = d_lookup(parent, &dname);
- boutc(cl, "d_lookup on parent=%p name=%.*s got %p\n",
- parent, dname.len, dname.name, dn);
+ CEPH_SAN_STRNCPY(result_str, sizeof(result_str), dname.name, dname.len);
+ boutc(cl, "d_lookup on parent=%p name=%s got %p\n",
+ parent, result_str, dn);
if (!dn) {
dn = d_alloc(parent, &dname);
- boutc(cl, "d_alloc %p '%.*s' = %p\n", parent,
- dname.len, dname.name, dn);
+ boutc(cl, "d_alloc %p '%s' = %p\n", parent,
+ result_str, dn);
if (!dn) {
boutc(cl, "d_alloc badness\n");
err = -ENOMEM;
struct fscrypt_str tname = FSTR_INIT(NULL, 0);
struct fscrypt_str oname = FSTR_INIT(NULL, 0);
struct ceph_fname fname;
+ char result_str[128];
+
u32 altname_len, _name_len;
u8 *altname, *_name;
ceph_decode_need(p, end, _name_len, bad);
_name = *p;
*p += _name_len;
- boutc(cl, "parsed dir dname '%.*s'\n", _name_len, _name);
+ CEPH_SAN_STRNCPY(result_str, sizeof(result_str), rde->name, rde->name_len);
+ boutc(cl, "parsed dir dname %s\n", result_str);
if (info->hash_order)
rde->raw_hash = ceph_str_hash(ci->i_dir_layout.dl_dir_hash,
int pos;
unsigned seq;
u64 base;
+ char result_str[128];
if (!dentry)
return ERR_PTR(-EINVAL);
*pbase = base;
*plen = PATH_MAX - 1 - pos;
- boutc(cl, "on %p %d built %llx '%.*s'\n", dentry, d_count(dentry),
- base, *plen, path + pos);
+ CEPH_SAN_STRNCPY(result_str, sizeof(result_str), path + pos, *plen);
+ boutc(cl, "on %p %d built %llx '%s'\n", dentry, d_count(dentry),
+ base, result_str);
return path + pos;
}
bool parent_locked)
{
struct ceph_client *cl = mdsc->fsc->client;
+ char result_str[128];
int r = 0;
if (rinode) {
} else if (rdentry) {
r = build_dentry_path(mdsc, rdentry, rdiri, ppath, pathlen, ino,
freepath, parent_locked);
- boutc(cl, " dentry %p %llx/%.*s\n", rdentry, *ino, *pathlen, *ppath);
+ CEPH_SAN_STRNCPY(result_str, sizeof(result_str), *ppath, *pathlen);
+ boutc(cl, " dentry %p %llx/%s\n", rdentry, *ino, result_str);
} else if (rpath || rino) {
*ino = rino;
*ppath = rpath;
*pathlen = rpath ? strlen(rpath) : 0;
- boutc(cl, " path %.*s\n", *pathlen, rpath);
+ CEPH_SAN_STRNCPY(result_str, sizeof(result_str), rpath, *pathlen);
+ boutc(cl," path %s\n", result_str);
}
return r;
struct ceph_mds_session *session,
struct ceph_msg *msg)
{
+ char result_str[128];
struct ceph_client *cl = mdsc->fsc->client;
struct super_block *sb = mdsc->fsc->sb;
struct inode *inode;
/* lookup inode */
inode = ceph_find_inode(sb, vino);
- boutc(cl, "%s, ino %llx %p %.*s\n", ceph_lease_op_name(h->action),
- vino.ino, inode, dname.len, dname.name);
+ CEPH_SAN_STRNCPY(result_str, sizeof(result_str), dname.name, dname.len);
+ boutc(cl, "%s, ino %llx %p %s\n", ceph_lease_op_name(h->action),
+ vino.ino, inode, result_str);
mutex_lock(&session->s_mutex);
if (!inode) {
int flags, int update_xattr,
struct ceph_inode_xattr **newxattr)
{
+ char result_str[128];
+ char result_str2[128];
struct inode *inode = &ci->netfs.inode;
struct ceph_client *cl = ceph_inode_to_client(inode);
struct rb_node **p;
boutc(cl, "p=%p\n", p);
}
- boutc(cl, "added %p %llx.%llx xattr %p %.*s=%.*s%s\n", inode,
- ceph_vinop(inode), xattr, name_len, name, min(val_len,
- MAX_XATTR_VAL_PRINT_LEN), val,
+ CEPH_SAN_STRNCPY(result_str, sizeof(result_str), name, name_len);
+ CEPH_SAN_STRNCPY(result_str2, sizeof(result_str2), val, min(val_len, MAX_XATTR_VAL_PRINT_LEN));
+ boutc(cl, "added %p %llx.%llx xattr %p %s=%s%s\n", inode,
+ ceph_vinop(inode), xattr, result_str, result_str2,
val_len > MAX_XATTR_VAL_PRINT_LEN ? "..." : "");
return 0;
static struct ceph_inode_xattr *__get_xattr(struct ceph_inode_info *ci,
const char *name)
{
+ char result_str[128];
struct ceph_client *cl = ceph_inode_to_client(&ci->netfs.inode);
struct rb_node **p;
struct rb_node *parent = NULL;
p = &(*p)->rb_right;
else {
int len = min(xattr->val_len, MAX_XATTR_VAL_PRINT_LEN);
-
- boutc(cl, "%s found %.*s%s\n", name, len, xattr->val,
+ CEPH_SAN_STRNCPY(result_str, sizeof(result_str), xattr->val, len);
+ boutc(cl, "%s found %s%s\n", name, result_str,
xattr->val_len > len ? "..." : "");
return xattr;
}
struct ceph_client *cl = ceph_inode_to_client(&ci->netfs.inode);
struct rb_node *p, *tmp;
struct ceph_inode_xattr *xattr = NULL;
+ char result_str[128];
p = rb_first(&ci->i_xattrs.index);
xattr = rb_entry(p, struct ceph_inode_xattr, node);
tmp = p;
p = rb_next(tmp);
- boutc(cl, "next p=%p (%.*s)\n", p, xattr->name_len, xattr->name);
+ CEPH_SAN_STRNCPY(result_str, sizeof(result_str), xattr->name, xattr->name_len);
+ boutc(cl, "next p=%p (%s)\n", p, result_str);
rb_erase(tmp, &ci->i_xattrs.index);
__free_xattr(xattr);