]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: kill derr, use pr_err instead
authorSage Weil <sage@newdream.net>
Thu, 16 Jul 2009 18:12:52 +0000 (11:12 -0700)
committerSage Weil <sage@newdream.net>
Thu, 16 Jul 2009 18:12:52 +0000 (11:12 -0700)
13 files changed:
src/TODO
src/kernel/caps.c
src/kernel/ceph_debug.h
src/kernel/export.c
src/kernel/inode.c
src/kernel/mds_client.c
src/kernel/mdsmap.c
src/kernel/messenger.c
src/kernel/mon_client.c
src/kernel/osd_client.c
src/kernel/osdmap.c
src/kernel/snap.c
src/kernel/super.c

index 0c3544ab55928e8454270842b953f4440bf1268e..e81817ef2dda0aa4f9e874cadd794037fac42524 100644 (file)
--- a/src/TODO
+++ b/src/TODO
@@ -33,7 +33,7 @@ v0.10
 
 kclient review
 - andi
-  - server-specified max file size
+/  - server-specified max file size
   - pr_debug
   - top of file comments
 
index 0a6213258d40372e1ea9ac5dbe967e7995068dfc..8a3af26b23b419c34bf75f108e84b467a9f80c93 100644 (file)
@@ -500,8 +500,8 @@ retry:
                                 &realm->inodes_with_caps);
                        spin_unlock(&realm->inodes_with_caps_lock);
                } else {
-                       derr(0, "couldn't find snap realm realmino=%llu\n",
-                               realmino);
+                       pr_err("ceph_add_cap: couldn't find snap realm %llu\n",
+                              realmino);
                }
        }
 
@@ -2410,7 +2410,8 @@ void ceph_handle_caps(struct ceph_mds_client *mdsc,
 
        default:
                spin_unlock(&inode->i_lock);
-               derr(10, " unknown cap op %d %s\n", op, ceph_cap_op_name(op));
+               pr_err("ceph_handle_caps: unknown cap op %d %s\n", op,
+                      ceph_cap_op_name(op));
        }
 
 done:
@@ -2425,7 +2426,7 @@ done:
        return;
 
 bad:
-       derr(10, "corrupt caps message\n");
+       pr_err("ceph_handle_caps: corrupt message\n");
        return;
 }
 
index 70a25216bbe500f797b1165513aaff9321799ec8..7cc14df7dcf3fa2b2f712022051d131127e90401 100644 (file)
@@ -76,11 +76,6 @@ extern int ceph_debug_tools __read_mostly;
 
 #define _dout(x, fmt, args...) dout_flag((x), DOUT_MASK, fmt FMT_SUFFIX, args)
 
-#define _derr(x, fmt, args...) do {                                    \
-               printk(KERN_ERR FMT_PREFIX fmt FMT_SUFFIX, LOG_ARGS, args); \
-       } while (0)
-
 #define dout(x, args...) _dout((x), args, TRAIL_PARAM)
-#define derr(x, args...) _derr((x), args, TRAIL_PARAM)
 
 #endif
index a6bca2f7fa77a7af34f4336ded2c78e300d9993b..0d0eeecd97dc2b8c2e3746fa276cdfb9f7fde3a4 100644 (file)
@@ -86,8 +86,8 @@ static struct dentry *__fh_to_dentry(struct super_block *sb,
        inode = ceph_find_inode(sb, fh->ino);
        if (!inode) {
                struct ceph_mds_request *req;
-               derr(10, "fh_to_dentry %llx.%x -- no inode\n", fh->ino.ino,
-                    hash);
+               pr_err("ceph fh_to_dentry %llx.%x -- no inode\n", fh->ino.ino,
+                      hash);
                req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_LOOKUPHASH,
                                               USE_ANY_MDS);
                if (IS_ERR(req))
@@ -111,9 +111,8 @@ static struct dentry *__fh_to_dentry(struct super_block *sb,
 #endif
 
        if (!dentry) {
-               derr(10, "fh_to_dentry %llx.%x -- inode %p but ENOMEM\n",
-                    fh->ino.ino,
-                    hash, inode);
+               pr_err("ceph fh_to_dentry %llx.%x -- inode %p but ENOMEM\n",
+                      fh->ino.ino, hash, inode);
                iput(inode);
                return ERR_PTR(-ENOMEM);
        }
@@ -143,7 +142,7 @@ static struct dentry *ceph_fh_to_parent(struct super_block *sb, struct fid *fid,
        u64 ino = get_unaligned((u64 *)fh);
        u32 hash = fh[2];
 
-       derr(10, "fh_to_parent %llx.%x\n", (unsigned long long)ino, hash);
+       pr_debug("ceph_fh_to_parent %llx.%x\n", (unsigned long long)ino, hash);
 
        if (fh_len < 6)
                return ERR_PTR(-ESTALE);
index 95f5cb9b83e8a2339e95e161640ffd41446c0c4a..abd3c32bdef69b90fc1f53e4cb6d42cbcbfc823f 100644 (file)
@@ -103,8 +103,9 @@ static struct ceph_inode_frag *__get_or_create_frag(struct ceph_inode_info *ci,
 
        frag = kmalloc(sizeof(*frag), GFP_NOFS);
        if (!frag) {
-               derr(0, "ENOMEM on %p %llx.%llx frag %x\n", &ci->vfs_inode,
-                    ceph_vinop(&ci->vfs_inode), f);
+               pr_err("ceph __get_or_create_frag ENOMEM on %p %llx.%llx "
+                      "frag %x\n", &ci->vfs_inode,
+                      ceph_vinop(&ci->vfs_inode), f);
                return ERR_PTR(-ENOMEM);
        }
        frag->frag = f;
@@ -215,8 +216,8 @@ static int ceph_fill_dirfrag(struct inode *inode,
        if (IS_ERR(frag)) {
                /* this is not the end of the world; we can continue
                   with bad/inaccurate delegation info */
-               derr(0, "fill_dirfrag ENOMEM on mds ref %llx.%llx frag %x\n",
-                    ceph_vinop(inode), le32_to_cpu(dirinfo->frag));
+               pr_err("ceph fill_dirfrag ENOMEM on mds ref %llx.%llx fg %x\n",
+                      ceph_vinop(inode), le32_to_cpu(dirinfo->frag));
                err = -ENOMEM;
                goto out;
        }
@@ -484,8 +485,8 @@ static int fill_inode(struct inode *inode,
        if (iinfo->xattr_len > 4 && iinfo->xattr_len != ci->i_xattrs.len) {
                xattr_data = kmalloc(iinfo->xattr_len, GFP_NOFS);
                if (!xattr_data)
-                       derr(10, "ENOMEM on xattr blob %d bytes\n",
-                            ci->i_xattrs.len);
+                       pr_err("ceph fill_inode ENOMEM xattr blob %d bytes\n",
+                              ci->i_xattrs.len);
        }
 
        spin_lock(&inode->i_lock);
@@ -660,8 +661,8 @@ no_change:
                }
                break;
        default:
-               derr(0, "BAD mode 0%o S_IFMT 0%o\n", inode->i_mode,
-                    inode->i_mode & S_IFMT);
+               pr_err("ceph fill_inode %llx.%llx BAD mode 0%o\n",
+                      ceph_vinop(inode), inode->i_mode);
                err = -EINVAL;
                goto out;
        }
@@ -769,8 +770,8 @@ static struct dentry *splice_dentry(struct dentry *dn, struct inode *in,
                d_drop(dn);
        realdn = d_materialise_unique(dn, in);
        if (IS_ERR(realdn)) {
-               derr(0, "error splicing %p (%d) inode %p ino %llx.%llx\n",
-                    dn, atomic_read(&dn->d_count), in, ceph_vinop(in));
+               pr_err("ceph splice_dentry error %p inode %p ino %llx.%llx\n",
+                      dn, in, ceph_vinop(in));
                if (prehash)
                        *prehash = false; /* don't rehash on error */
                dn = realdn; /* note realdn contains the error */
@@ -946,7 +947,8 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req,
                if (!dn->d_inode) {
                        in = ceph_get_inode(sb, vino);
                        if (IS_ERR(in)) {
-                               derr(30, "get_inode badness\n");
+                               pr_err("ceph fill_trace bad get_inode "
+                                      "%llx.%llx\n", vino.ino, vino.snap);
                                err = PTR_ERR(in);
                                d_delete(dn);
                                goto done;
@@ -987,7 +989,8 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req,
                vino.snap = le64_to_cpu(ininfo->snapid);
                in = ceph_get_inode(sb, vino);
                if (IS_ERR(in)) {
-                       derr(30, "get_inode badness\n");
+                       pr_err("ceph fill_inode get_inode badness %llx.%llx\n",
+                              vino.ino, vino.snap);
                        err = PTR_ERR(in);
                        d_delete(dn);
                        goto done;
@@ -1024,7 +1027,8 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req,
                                 req->r_fmode : -1,
                                 &req->r_caps_reservation);
                if (err < 0) {
-                       derr(30, "fill_inode badness\n");
+                       pr_err("ceph fill_inode badness %p %llx.%llx\n",
+                              in, ceph_vinop(in));
                        goto done;
                }
        }
@@ -1720,8 +1724,9 @@ static int __set_xattr(struct ceph_inode_info *ci,
                ci->i_xattrs.vals_size -= xattr->val_len;
        }
        if (!xattr) {
-               derr(0, "ENOMEM on %p %llx.%llx xattr %s=%s\n", &ci->vfs_inode,
-                    ceph_vinop(&ci->vfs_inode), name, xattr->val);
+               pr_err("ceph __set_xattr ENOMEM on %p %llx.%llx xattr %s=%s\n",
+                      &ci->vfs_inode, ceph_vinop(&ci->vfs_inode), name,
+                      xattr->val);
                return -ENOMEM;
        }
        ci->i_xattrs.names_size += name_len;
index 4fb217b8df63bd38ae037cb59834845e1080b031..3971c3512af0f0a6a8f503835063bbfb247f6264 100644 (file)
@@ -103,7 +103,7 @@ static int parse_reply_info_trace(void **p, void *end,
 bad:
        err = -EIO;
 out_bad:
-       derr(1, "problem parsing trace %d\n", err);
+       pr_err("ceph problem parsing mds trace %d\n", err);
        return err;
 }
 
@@ -174,7 +174,7 @@ done:
 bad:
        err = -EIO;
 out_bad:
-       derr(1, "problem parsing dir contents %d\n", err);
+       pr_err("ceph problem parsing dir contents %d\n", err);
        return err;
 }
 
@@ -221,7 +221,7 @@ static int parse_reply_info(struct ceph_msg *msg,
 bad:
        err = -EIO;
 out_bad:
-       derr(1, "parse_reply err %d\n", err);
+       pr_err("ceph mds parse_reply err %d\n", err);
        return err;
 }
 
@@ -563,7 +563,7 @@ static struct ceph_msg *create_session_msg(u32 op, u64 seq)
 
        msg = ceph_msg_new(CEPH_MSG_CLIENT_SESSION, sizeof(*h), 0, 0, NULL);
        if (IS_ERR(msg)) {
-               derr("ENOMEM creating session msg\n");
+               pr_err("ceph create_session_msg ENOMEM creating msg\n");
                return ERR_PTR(PTR_ERR(msg));
        }
        h = msg->front.iov_base;
@@ -1026,7 +1026,8 @@ retry:
                        len += 1 + temp->d_name.len;
                temp = temp->d_parent;
                if (temp == NULL) {
-                       derr(1, "corrupt dentry %p\n", dentry);
+                       pr_err("ceph build_path_dentry corrupt dentry %p\n",
+                              dentry);
                        return ERR_PTR(-EINVAL);
                }
        }
@@ -1060,14 +1061,14 @@ retry:
                        path[--pos] = '/';
                temp = temp->d_parent;
                if (temp == NULL) {
-                       derr(1, "corrupt dentry\n");
+                       pr_err("ceph build_path_dentry corrupt dentry\n");
                        kfree(path);
                        return ERR_PTR(-EINVAL);
                }
        }
        if (pos != 0) {
-               derr(1, "did not end path lookup where expected, "
-                    "namelen is %d, pos is %d\n", len, pos);
+               pr_err("ceph build_path_dentry did not end path lookup where "
+                      "expected, namelen is %d, pos is %d\n", len, pos);
                /* presumably this is only possible if racing with a
                   rename of one of the parent directories (we can not
                   lock the dentries above us to prevent this, but
@@ -1519,7 +1520,7 @@ void ceph_mdsc_handle_reply(struct ceph_mds_client *mdsc, struct ceph_msg *msg)
        if (le32_to_cpu(msg->hdr.src.name.type) != CEPH_ENTITY_TYPE_MDS)
                return;
        if (msg->front.iov_len < sizeof(*head)) {
-               derr(1, "handle_reply got corrupt (short) reply\n");
+               pr_err("ceph_mdsc_handle_reply got corrupt (short) reply\n");
                return;
        }
 
@@ -1574,8 +1575,8 @@ void ceph_mdsc_handle_reply(struct ceph_mds_client *mdsc, struct ceph_msg *msg)
                req->r_session = __ceph_lookup_mds_session(mdsc, mds);
        }
        if (req->r_session == NULL) {
-               derr(1, "got reply on %llu, but no session for mds%d\n",
-                    tid, mds);
+               pr_err("ceph_mdsc_handle_reply got %llu, but no session for"
+                      " mds%d\n", tid, mds);
                mutex_unlock(&mdsc->mutex);
                goto out;
        }
@@ -1594,7 +1595,7 @@ void ceph_mdsc_handle_reply(struct ceph_mds_client *mdsc, struct ceph_msg *msg)
        rinfo = &req->r_reply_info;
        err = parse_reply_info(msg, rinfo);
        if (err < 0) {
-               derr(0, "handle_reply got corrupt reply\n");
+               pr_err("ceph_mdsc_handle_reply got corrupt reply mds%d\n", mds);
                goto out_err;
        }
        result = le32_to_cpu(rinfo->head->result);
@@ -1719,7 +1720,7 @@ out:
        return;
 
 bad:
-       derr(0, "problem decoding message, err=%d\n", err);
+       pr_err("ceph_mdsc_handle_forward decode error err=%d\n", err);
 }
 
 /*
@@ -1801,7 +1802,7 @@ void ceph_mdsc_handle_session(struct ceph_mds_client *mdsc,
                break;
 
        default:
-               derr(0, "bad session op %d from mds%d\n", op, mds);
+               pr_err("ceph_mdsc_handle_session bad op %d mds%d\n", op, mds);
                WARN_ON(1);
        }
 
@@ -1815,8 +1816,8 @@ void ceph_mdsc_handle_session(struct ceph_mds_client *mdsc,
        return;
 
 bad:
-       derr(1, "corrupt mds%d session message, len %d, expected %d\n", mds,
-            (int)msg->front.iov_len, (int)sizeof(*h));
+       pr_err("ceph_mdsc_handle_session corrupt message mds%d len %d\n", mds,
+              (int)msg->front.iov_len);
        return;
 }
 
@@ -1969,7 +1970,8 @@ retry:
        reply = ceph_msg_new(CEPH_MSG_CLIENT_RECONNECT, len, 0, 0, NULL);
        if (IS_ERR(reply)) {
                err = PTR_ERR(reply);
-               derr(0, "ENOMEM trying to send mds reconnect to mds%d\n", mds);
+               pr_err("ceph send_mds_reconnect ENOMEM on %d for mds%d\n",
+                      len, mds);
                goto out;
        }
        p = reply->front.iov_base;
@@ -2073,7 +2075,7 @@ needmore:
  */
 void ceph_mdsc_handle_reset(struct ceph_mds_client *mdsc, int mds)
 {
-       derr(1, "mds%d gave us the boot.  IMPLEMENT RECONNECT.\n", mds);
+       pr_err("ceph mds%d gave us the boot.  IMPLEMENT RECONNECT.\n", mds);
 }
 
 
@@ -2204,7 +2206,8 @@ void ceph_mdsc_handle_lease(struct ceph_mds_client *mdsc, struct ceph_msg *msg)
        session = __ceph_lookup_mds_session(mdsc, mds);
        mutex_unlock(&mdsc->mutex);
        if (!session) {
-               derr(0, "WTF, got lease but no session for mds%d\n", mds);
+               pr_err("ceph handle_lease got lease but no session mds%d\n",
+                      mds);
                return;
        }
 
@@ -2403,8 +2406,8 @@ static void delayed_work(struct work_struct *work)
                        continue;
                }
                if (s->s_ttl && time_after(jiffies, s->s_ttl)) {
-                       derr(1, "mds%d session probably timed out, "
-                            "requesting mds map\n", s->s_mds);
+                       pr_info("ceph mds%d session probably timed out, "
+                               "requesting mds map\n", s->s_mds);
                        want_map = mdsc->mdsmap->m_epoch + 1;
                }
                if (s->s_state < CEPH_MDS_SESSION_OPEN) {
@@ -2730,7 +2733,7 @@ void ceph_mdsc_handle_map(struct ceph_mds_client *mdsc, struct ceph_msg *msg)
        ceph_decode_need(&p, end, sizeof(fsid)+2*sizeof(u32), bad);
        ceph_decode_copy(&p, &fsid, sizeof(fsid));
        if (ceph_fsid_compare(&fsid, &mdsc->client->monc.monmap->fsid)) {
-               derr(0, "got mdsmap with wrong fsid\n");
+               pr_err("ceph got mdsmap with wrong fsid\n");
                return;
        }
        ceph_decode_32(&p, epoch);
@@ -2773,7 +2776,7 @@ void ceph_mdsc_handle_map(struct ceph_mds_client *mdsc, struct ceph_msg *msg)
 bad_unlock:
        mutex_unlock(&mdsc->mutex);
 bad:
-       derr(1, "problem with mdsmap %d\n", err);
+       pr_err("ceph error decoding mdsmap %d\n", err);
        return;
 }
 
index cda76c7b933390ae44e1292c20dd83777ce69e4d..a9638054212aea5abc4bd2f5668b76d9939149ec 100644 (file)
@@ -119,7 +119,7 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end)
 badmem:
        err = -ENOMEM;
 bad:
-       derr(0, "corrupt mdsmap\n");
+       pr_err("ceph corrupt mdsmap\n");
        ceph_mdsmap_destroy(m);
        return ERR_PTR(-EINVAL);
 }
index 238632aa3fdedd3e87d337935a035f62c5dcfff4..9db07ca80a49898befb5c51621bcdf775bc0272b 100644 (file)
@@ -37,7 +37,7 @@ int ceph_msgr_init(void)
        ceph_msgr_wq = create_workqueue("ceph-msgr");
        if (IS_ERR(ceph_msgr_wq)) {
                int ret = PTR_ERR(ceph_msgr_wq);
-               derr(0, "failed to create workqueue: %d\n", ret);
+               pr_err("ceph_msgr_init failed to create workqueue: %d\n", ret);
                ceph_msgr_wq = NULL;
                return ret;
        }
@@ -214,8 +214,8 @@ static struct socket *ceph_tcp_connect(struct ceph_connection *con)
                ret = 0;
        }
        if (ret < 0) {
-               derr(1, "connect %u.%u.%u.%u:%u error %d\n",
-                    IPQUADPORT(*(struct sockaddr_in *)paddr), ret);
+               pr_err("ceph connect %u.%u.%u.%u:%u error %d\n",
+                       IPQUADPORT(*(struct sockaddr_in *)paddr), ret);
                sock_release(sock);
                con->sock = NULL;
                con->error_msg = "connect error";
@@ -244,14 +244,14 @@ static int ceph_tcp_listen(struct ceph_messenger *msgr)
        ret = kernel_setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
                                (char *)&optval, sizeof(optval));
        if (ret < 0) {
-               derr(0, "failed to set SO_REUSEADDR: %d\n", ret);
+               pr_err("ceph failed to set SO_REUSEADDR: %d\n", ret);
                goto err;
        }
 
        ret = sock->ops->bind(sock, (struct sockaddr *)myaddr,
                              sizeof(*myaddr));
        if (ret < 0) {
-               derr(0, "Failed to bind: %d\n", ret);
+               pr_err("ceph failed to bind: %d\n", ret);
                goto err;
        }
 
@@ -260,7 +260,7 @@ static int ceph_tcp_listen(struct ceph_messenger *msgr)
        ret = sock->ops->getname(sock, (struct sockaddr *)myaddr, &nlen,
                                 0);
        if (ret < 0) {
-               derr(0, "failed to getsockname: %d\n", ret);
+               pr_err("ceph failed to getsockname: %d\n", ret);
                goto err;
        }
        dout(0, "listening on %u.%u.%u.%u:%u\n", IPQUADPORT(*myaddr));
@@ -294,7 +294,7 @@ static int ceph_tcp_accept(struct socket *lsock, struct ceph_connection *con)
 
        ret = lsock->ops->accept(lsock, sock, O_NONBLOCK);
        if (ret < 0) {
-               derr(0, "accept error: %d\n", ret);
+               pr_err("ceph accept error: %d\n", ret);
                goto err;
        }
 
@@ -1050,8 +1050,8 @@ out:
 static int verify_hello(struct ceph_connection *con)
 {
        if (memcmp(con->in_banner, CEPH_BANNER, strlen(CEPH_BANNER))) {
-               derr(10, "connection to/from %u.%u.%u.%u:%u has bad banner\n",
-                    IPQUADPORT(con->peer_addr.ipaddr));
+               pr_err("ceph connect to/from %u.%u.%u.%u:%u has bad banner\n",
+                      IPQUADPORT(con->peer_addr.ipaddr));
                con->error_msg = "protocol error, bad banner";
                return -1;
        }
@@ -1064,9 +1064,9 @@ static int verify_hello(struct ceph_connection *con)
  */
 static void reset_connection(struct ceph_connection *con)
 {
-       derr(1, "%s%d %u.%u.%u.%u:%u connection reset\n",
-            ENTITY_NAME(con->peer_name),
-            IPQUADPORT(con->peer_addr.ipaddr));
+       pr_err("ceph %s%d %u.%u.%u.%u:%u connection reset\n",
+              ENTITY_NAME(con->peer_name),
+              IPQUADPORT(con->peer_addr.ipaddr));
 
        /* reset connection, out_queue, msg_ and connect_seq */
        /* discard existing out_queue and msg_seq */
@@ -1101,12 +1101,12 @@ static int process_connect(struct ceph_connection *con)
              con->actual_peer_addr.ipaddr.sin_port ==
              con->peer_addr.ipaddr.sin_port &&
              con->actual_peer_addr.nonce == con->peer_addr.nonce)) {
-               derr(1, "process_connect wrong peer, want %u.%u.%u.%u:%u/%d, "
-                    "got %u.%u.%u.%u:%u/%d, wtf\n",
-                    IPQUADPORT(con->peer_addr.ipaddr),
-                    con->peer_addr.nonce,
-                    IPQUADPORT(con->actual_peer_addr.ipaddr),
-                    con->actual_peer_addr.nonce);
+               pr_err("ceph wrong peer, want %u.%u.%u.%u:%u/%d, "
+                      "got %u.%u.%u.%u:%u/%d, wtf\n",
+                      IPQUADPORT(con->peer_addr.ipaddr),
+                      con->peer_addr.nonce,
+                      IPQUADPORT(con->actual_peer_addr.ipaddr),
+                      con->actual_peer_addr.nonce);
                con->error_msg = "protocol error, wrong peer";
                return -1;
        }
@@ -1190,7 +1190,7 @@ static int process_connect(struct ceph_connection *con)
                break;
 
        default:
-               derr(1, "process_connect protocol error, will retry\n");
+               pr_err("ceph connect protocol error, will retry\n");
                con->error_msg = "protocol error, garbage tag during connect";
                return -1;
        }
@@ -1244,7 +1244,7 @@ static int process_accept(struct ceph_connection *con)
 
        /* do we have an existing connection for this peer? */
        if (radix_tree_preload(GFP_NOFS) < 0) {
-               derr(10, "ENOMEM in process_accept\n");
+               pr_err("ceph ENOMEM in process_accept\n");
                con->error_msg = "out of memory";
                return -1;
        }
@@ -1438,9 +1438,9 @@ static int read_partial_message(struct ceph_connection *con)
                        if (crc != le32_to_cpu(m->hdr.crc)) {
                                print_section("hdr", (u8 *)&m->hdr,
                                              sizeof(m->hdr));
-                               derr(0, "read_partial_message %p bad hdr crc"
-                                    " %u != expected %u\n",
-                                    m, crc, m->hdr.crc);
+                               pr_err("ceph read_partial_message %p bad hdr "
+                                      " crc %u != expected %u\n",
+                                      m, crc, m->hdr.crc);
                                return -EBADMSG;
                        }
                }
@@ -1545,9 +1545,9 @@ no_data:
 
        /* crc ok? */
        if (con->in_front_crc != le32_to_cpu(m->footer.front_crc)) {
-               derr(0, "read_partial_message %p front crc %u != expected %u\n",
-                    con->in_msg,
-                    con->in_front_crc, m->footer.front_crc);
+               pr_err("ceph read_partial_message %p front crc %u != exp. %u\n",
+                      con->in_msg,
+                      con->in_front_crc, m->footer.front_crc);
                print_section("front", (u8 *)&m->front.iov_base,
                              sizeof(m->front.iov_len));
                return -EBADMSG;
@@ -1556,9 +1556,9 @@ no_data:
            (le32_to_cpu(m->footer.flags) & CEPH_MSG_FOOTER_NOCRC) == 0 &&
            con->in_data_crc != le32_to_cpu(m->footer.data_crc)) {
                int cur_page, data_pos;
-               derr(0, "read_partial_message %p data crc %u != expected %u\n",
-                    con->in_msg,
-                    con->in_data_crc, m->footer.data_crc);
+               pr_err("ceph read_partial_message %p data crc %u != exp. %u\n",
+                      con->in_msg,
+                      con->in_data_crc, m->footer.data_crc);
                for (data_pos = 0, cur_page = 0; data_pos < data_len;
                     data_pos += PAGE_SIZE, cur_page++) {
                        left = min((int)(data_len - data_pos),
@@ -1566,7 +1566,6 @@ no_data:
                        mutex_lock(&m->page_mutex);
 
                        if (!m->pages) {
-                               derr(0, "m->pages == NULL\n");
                                mutex_unlock(&m->page_mutex);
                                break;
                        }
@@ -1842,7 +1841,7 @@ out:
        return ret;
 
 bad_tag:
-       derr(2, "try_read bad con->in_tag = %d\n", (int)con->in_tag);
+       pr_err("ceph try_read bad con->in_tag = %d\n", (int)con->in_tag);
        con->error_msg = "protocol error, garbage tag";
        ret = -1;
        goto out;
@@ -1945,8 +1944,8 @@ out:
  */
 static void ceph_fault(struct ceph_connection *con)
 {
-       derr(1, "%s%d %u.%u.%u.%u:%u %s\n", ENTITY_NAME(con->peer_name),
-            IPQUADPORT(con->peer_addr.ipaddr), con->error_msg);
+       pr_err("ceph %s%d %u.%u.%u.%u:%u %s\n", ENTITY_NAME(con->peer_name),
+              IPQUADPORT(con->peer_addr.ipaddr), con->error_msg);
        dout(10, "fault %p state %lu to peer %u.%u.%u.%u:%u\n",
             con, con->state, IPQUADPORT(con->peer_addr.ipaddr));
 
@@ -2003,7 +2002,7 @@ static void accept_work(struct work_struct *work)
        /* initialize the msgr connection */
        newcon = new_connection(msgr);
        if (newcon == NULL) {
-               derr(1, "kmalloc failure accepting new connection\n");
+               pr_err("ceph ENOMEM accepting new connection\n");
                return;
        }
 
@@ -2012,7 +2011,7 @@ static void accept_work(struct work_struct *work)
        newcon->in_tag = CEPH_MSGR_TAG_READY;  /* eventually, hopefully */
 
        if (ceph_tcp_accept(msgr->listen_sock, newcon) < 0) {
-               derr(1, "error accepting connection\n");
+               pr_err("ceph error accepting connection\n");
                put_connection(newcon);
                return;
        }
@@ -2220,7 +2219,7 @@ int ceph_msg_send(struct ceph_messenger *msgr, struct ceph_msg *msg,
 
                ret = radix_tree_preload(GFP_NOFS);
                if (ret < 0) {
-                       derr(10, "ENOMEM in ceph_msg_send\n");
+                       pr_err("ceph ENOMEM in ceph_msg_send\n");
                        return ret;
                }
 
@@ -2327,7 +2326,7 @@ struct ceph_msg *ceph_msg_new(int type, int front_len,
                        m->front.iov_base = kmalloc(front_len, GFP_NOFS);
                }
                if (m->front.iov_base == NULL) {
-                       derr(0, "ceph_msg_new can't allocate %d bytes\n",
+                       pr_err("ceph_msg_new can't allocate %d bytes\n",
                             front_len);
                        goto out2;
                }
@@ -2347,7 +2346,7 @@ struct ceph_msg *ceph_msg_new(int type, int front_len,
 out2:
        ceph_msg_put(m);
 out:
-       derr(0, "msg_new can't create msg type %d len %d\n", type, front_len);
+       pr_err("ceph_msg_new can't create type %d len %d\n", type, front_len);
        return ERR_PTR(-ENOMEM);
 }
 
@@ -2356,14 +2355,14 @@ void ceph_msg_put(struct ceph_msg *m)
        dout(20, "ceph_msg_put %p %d -> %d\n", m, atomic_read(&m->nref),
             atomic_read(&m->nref)-1);
        if (atomic_read(&m->nref) <= 0) {
-               derr(0, "bad ceph_msg_put on %p %llu %s%d->%s%d %d=%s %d+%d\n",
-                    m, le64_to_cpu(m->hdr.seq),
-                    ENTITY_NAME(m->hdr.src.name),
-                    ENTITY_NAME(m->hdr.dst.name),
-                    le16_to_cpu(m->hdr.type),
-                    ceph_msg_type_name(le16_to_cpu(m->hdr.type)),
-                    le32_to_cpu(m->hdr.front_len),
-                    le32_to_cpu(m->hdr.data_len));
+               pr_err("bad ceph_msg_put on %p %llu %s%d->%s%d %d=%s %d+%d\n",
+                      m, le64_to_cpu(m->hdr.seq),
+                      ENTITY_NAME(m->hdr.src.name),
+                      ENTITY_NAME(m->hdr.dst.name),
+                      le16_to_cpu(m->hdr.type),
+                      ceph_msg_type_name(le16_to_cpu(m->hdr.type)),
+                      le32_to_cpu(m->hdr.front_len),
+                      le32_to_cpu(m->hdr.data_len));
                WARN_ON(1);
        }
        if (atomic_dec_and_test(&m->nref)) {
index 2590e35b9b86e08cac83283276a825e47170ba2b..fe4ed2cf7e382fc35dc791cc2aa3c91ea4e83fb8 100644 (file)
@@ -306,7 +306,7 @@ void ceph_monc_handle_statfs_reply(struct ceph_mon_client *monc,
        return;
 
 bad:
-       derr(10, "corrupt statfs reply, no tid\n");
+       pr_err("ceph corrupt statfs reply, no tid\n");
 }
 
 /*
@@ -353,7 +353,7 @@ int ceph_monc_do_statfs(struct ceph_mon_client *monc, struct ceph_statfs *buf)
        memset(&req.kobj, 0, sizeof(req.kobj));
        if (radix_tree_insert(&monc->statfs_request_tree, req.tid, &req) < 0) {
                mutex_unlock(&monc->statfs_mutex);
-               derr(10, "ENOMEM in do_statfs\n");
+               pr_err("ceph ENOMEM in do_statfs\n");
                return -ENOMEM;
        }
        if (monc->num_statfs_requests == 0)
index 797b12ff1851f5f42bfcf374877c882f62aaea56..8144c6a3f03d92923baea16a0b1ef6cb33d4b283 100644 (file)
@@ -355,8 +355,8 @@ static int map_osds(struct ceph_osd_client *osdc,
        ruleno = crush_find_rule(osdc->osdmap->crush, pool->v.crush_ruleset,
                                 pool->v.type, pool->v.size);
        if (ruleno < 0) {
-               derr(0, "map_osds no crush rule for pool %d type %d size %d\n",
-                    pgid.pg.pool, pool->v.type, pool->v.size);
+               pr_err("ceph map_osds no crush rule pool %d type %d size %d\n",
+                      pgid.pg.pool, pool->v.type, pool->v.size);
                return -1;
        }
 
@@ -510,9 +510,9 @@ done:
        return;
 
 bad:
-       derr(0, "got corrupt osd_op_reply got %d %d expected %d\n",
-            (int)msg->front.iov_len, le32_to_cpu(msg->hdr.front_len),
-            (int)sizeof(*rhead));
+       pr_err("ceph corrupt osd_op_reply got %d %d expected %d\n",
+              (int)msg->front.iov_len, le32_to_cpu(msg->hdr.front_len),
+              (int)sizeof(*rhead));
 }
 
 
@@ -599,7 +599,7 @@ void ceph_osdc_handle_map(struct ceph_osd_client *osdc, struct ceph_msg *msg)
        ceph_decode_need(&p, end, sizeof(fsid), bad);
        ceph_decode_copy(&p, &fsid, sizeof(fsid));
        if (ceph_fsid_compare(&fsid, &osdc->client->monc.monmap->fsid)) {
-               derr(0, "got map with wrong fsid, ignoring\n");
+               pr_err("ceph got osdmap with wrong fsid, ignoring\n");
                return;
        }
 
@@ -677,7 +677,7 @@ done:
        return;
 
 bad:
-       derr(1, "handle_map corrupt msg\n");
+       pr_err("ceph osdc handle_map corrupt msg\n");
        up_write(&osdc->map_sem);
        return;
 }
index 555c2025ff18076dd5e6fbc77776d0e9cd06bb4a..a58d50157806e9e639deb23fd20c994898796fc1 100644 (file)
@@ -155,8 +155,8 @@ static struct crush_map *crush_decode(void *pbyval, void *end)
        ceph_decode_need(p, end, 4*sizeof(u32), bad);
        ceph_decode_32(p, magic);
        if (magic != CRUSH_MAGIC) {
-               derr(0, "crush_decode magic %x != current %x\n",
-                    (unsigned)magic, (unsigned)CRUSH_MAGIC);
+               pr_err("ceph crush_decode magic %x != current %x\n",
+                      (unsigned)magic, (unsigned)CRUSH_MAGIC);
                goto bad;
        }
        ceph_decode_32(p, c->max_buckets);
@@ -595,8 +595,8 @@ struct ceph_osdmap *apply_incremental(void **p, void *end,
        return map;
 
 bad:
-       derr(10, "corrupt incremental osdmap epoch %d off %d (%p of %p-%p)\n",
-            epoch, (int)(*p - start), *p, start, end);
+       pr_err("ceph corrupt inc osdmap epoch %d off %d (%p of %p-%p)\n",
+              epoch, (int)(*p - start), *p, start, end);
        if (newcrush)
                crush_destroy(newcrush);
        return ERR_PTR(err);
index 170edac6dfc3dae5a9b8ed2e8f5f260f796f15ec..f0707fa5096230668a017464fcf7c03abbdfd9ec 100644 (file)
@@ -349,8 +349,8 @@ fail:
                ceph_put_snap_context(realm->cached_context);
                realm->cached_context = NULL;
        }
-       derr(0, "build_snap_context %llx %p fail %d\n", realm->ino,
-            realm, err);
+       pr_err("ceph build_snap_context %llx %p fail %d\n", realm->ino,
+              realm, err);
        return err;
 }
 
@@ -414,7 +414,7 @@ void ceph_queue_cap_snap(struct ceph_inode_info *ci,
 
        capsnap = kzalloc(sizeof(*capsnap), GFP_NOFS);
        if (!capsnap) {
-               derr(10, "ENOMEM allocating ceph_cap_snap on %p\n", inode);
+               pr_err("ceph ENOMEM allocating ceph_cap_snap on %p\n", inode);
                return;
        }
        atomic_set(&capsnap->nref, 1);
@@ -630,7 +630,7 @@ more:
 bad:
        err = -EINVAL;
 fail:
-       derr(10, "update_snap_trace error %d\n", err);
+       pr_err("ceph update_snap_trace error %d\n", err);
        return err;
 }
 
@@ -879,7 +879,7 @@ void ceph_handle_snap(struct ceph_mds_client *mdsc,
        return;
 
 bad:
-       derr(10, "corrupt snap message from mds%d\n", mds);
+       pr_err("ceph corrupt snap message from mds%d\n", mds);
 out:
        if (locked_rwsem)
                up_write(&mdsc->snap_rwsem);
index b884e7ad207c2c5c8df9a319620faeba15badae7..0df2e65b116019234b092e333cb7256dc8cb56fb 100644 (file)
@@ -57,7 +57,7 @@ static void ceph_put_super(struct super_block *s)
                                (cl->mount_state == CEPH_MOUNT_UNMOUNTED),
                                seconds*HZ);
                if (rc == 0)
-                       derr(0, "umount timed out after %d seconds\n", seconds);
+                       pr_err("ceph umount timedout after %d s\n", seconds);
        }
 
        return;
@@ -266,7 +266,8 @@ static int handle_mount_ack(struct ceph_client *client, struct ceph_msg *msg)
        ceph_decode_need(&p, end, len, bad);
        monmap = ceph_monmap_decode(p, p + len);
        if (IS_ERR(monmap)) {
-               derr(0, "problem decoding monmap, %d\n", (int)PTR_ERR(monmap));
+               pr_err("ceph problem decoding monmap, %d\n",
+                      (int)PTR_ERR(monmap));
                return -EINVAL;
        }
        p += len;
@@ -277,8 +278,8 @@ static int handle_mount_ack(struct ceph_client *client, struct ceph_msg *msg)
 
        client->signed_ticket = kmalloc(len, GFP_KERNEL);
        if (!client->signed_ticket) {
-               derr(0, "problem allocating %d bytes for client ticket\n",
-                    len);
+               pr_err("ceph ENOMEM allocating %d bytes for client ticket\n",
+                      len);
                err = -ENOMEM;
                goto out;
        }
@@ -298,7 +299,7 @@ static int handle_mount_ack(struct ceph_client *client, struct ceph_msg *msg)
        return 0;
 
 bad:
-       derr(0, "error decoding mount_ack message\n");
+       pr_err("ceph error decoding mount_ack message\n");
 out:
        kfree(monmap);
        return err;
@@ -500,7 +501,7 @@ static int parse_ip(const char *c, int len, struct ceph_entity_addr *addr,
        return 0;
 
 bad:
-       derr(1, "parse_ip bad ip '%s'\n", c);
+       pr_err("ceph parse_ip bad ip '%s'\n", c);
        return -EINVAL;
 }
 
@@ -562,7 +563,7 @@ static int parse_mount_args(int flags, char *options, const char *dev_name,
                        continue;
                token = match_token(c, arg_tokens, argstr);
                if (token < 0) {
-                       derr(0, "bad mount option at '%s'\n", c);
+                       pr_err("ceph bad mount option at '%s'\n", c);
                        return -EINVAL;
 
                }
@@ -989,8 +990,8 @@ void ceph_dispatch(void *p, struct ceph_msg *msg)
                break;
 
        default:
-               derr(0, "received unknown message type %d %s\n", type,
-                    ceph_msg_type_name(type));
+               pr_err("ceph received unknown message type %d %s\n", type,
+                      ceph_msg_type_name(type));
        }
 
        ceph_msg_put(msg);