diff --git a/lustre/include/lustre_dlm.h b/lustre/include/lustre_dlm.h index c0184e887bbd6170a1055d386e157c624152fa3f..632b7bb7fdc46105364b2f5e661a01297dc878b6 100644 --- a/lustre/include/lustre_dlm.h +++ b/lustre/include/lustre_dlm.h @@ -398,15 +398,16 @@ extern char *ldlm_it2str(int it); void _ldlm_lock_debug(struct ldlm_lock *lock, __u32 mask, struct libcfs_debug_msg_data *data, const char *fmt, - ...); + ...) + __attribute__ ((format (printf, 4, 5))); #define LDLM_ERROR(lock, fmt, a...) do { \ static cfs_debug_limit_state_t _ldlm_cdls; \ ldlm_lock_debug(&_ldlm_cdls, D_ERROR, lock, \ __FILE__, __FUNCTION__, __LINE__, \ "### " fmt , ##a); \ - } while (0) - +} while (0) + #define LDLM_DEBUG(lock, fmt, a...) do { \ ldlm_lock_debug(NULL, D_DLMTRACE, lock, \ __FILE__, __FUNCTION__, __LINE__, \ diff --git a/lustre/include/lustre_net.h b/lustre/include/lustre_net.h index cb942bbf28a966db049189d72a33523e8a22415a..0e9b401ec3fce8641e1dabef808c62412b911132 100644 --- a/lustre/include/lustre_net.h +++ b/lustre/include/lustre_net.h @@ -402,43 +402,44 @@ ptlrpc_rqphase2str(struct ptlrpc_request *req) /* Spare the preprocessor, spoil the bugs. */ #define FLAG(field, str) (field ? str : "") -#define DEBUG_REQ_FLAGS(req) \ - ptlrpc_rqphase2str(req), \ - FLAG(req->rq_intr, "I"), FLAG(req->rq_replied, "R"), \ - FLAG(req->rq_err, "E"), \ - FLAG(req->rq_timedout, "X") /* eXpired */, FLAG(req->rq_resend, "S"), \ - FLAG(req->rq_restart, "T"), FLAG(req->rq_replay, "P"), \ - FLAG(req->rq_no_resend, "N"), \ +#define DEBUG_REQ_FLAGS(req) \ + ptlrpc_rqphase2str(req), \ + FLAG(req->rq_intr, "I"), FLAG(req->rq_replied, "R"), \ + FLAG(req->rq_err, "E"), \ + FLAG(req->rq_timedout, "X") /* eXpired */, FLAG(req->rq_resend, "S"), \ + FLAG(req->rq_restart, "T"), FLAG(req->rq_replay, "P"), \ + FLAG(req->rq_no_resend, "N"), \ FLAG(req->rq_waiting, "W") #define REQ_FLAGS_FMT "%s:%s%s%s%s%s%s%s%s%s" void _debug_req(struct ptlrpc_request *req, __u32 mask, - struct libcfs_debug_msg_data *data, const char *fmt, ...); - -#define debug_req(cdls, level, req, file, func, line, fmt, a...) \ -do { \ - CHECK_STACK(); \ - \ - if (((level) & D_CANTMASK) != 0 || \ - ((libcfs_debug & (level)) != 0 && \ - (libcfs_subsystem_debug & DEBUG_SUBSYSTEM) != 0)) { \ - static struct libcfs_debug_msg_data _req_dbg_data = \ - DEBUG_MSG_DATA_INIT(cdls, DEBUG_SUBSYSTEM, file, func, line); \ - _debug_req((req), (level), &_req_dbg_data, fmt, ##a); \ - } \ + struct libcfs_debug_msg_data *data, const char *fmt, ...) + __attribute__ ((format (printf, 4, 5))); + +#define debug_req(cdls, level, req, file, func, line, fmt, a...) \ +do { \ + CHECK_STACK(); \ + \ + if (((level) & D_CANTMASK) != 0 || \ + ((libcfs_debug & (level)) != 0 && \ + (libcfs_subsystem_debug & DEBUG_SUBSYSTEM) != 0)) { \ + static struct libcfs_debug_msg_data _req_dbg_data = \ + DEBUG_MSG_DATA_INIT(cdls, DEBUG_SUBSYSTEM, file, func, line); \ + _debug_req((req), (level), &_req_dbg_data, fmt, ##a); \ + } \ } while(0) /* for most callers (level is a constant) this is resolved at compile time */ -#define DEBUG_REQ(level, req, fmt, args...) \ -do { \ - if ((level) & (D_ERROR | D_WARNING)) { \ - static cfs_debug_limit_state_t cdls; \ - debug_req(&cdls, level, req, __FILE__, __func__, __LINE__, \ - "@@@ "fmt, ## args); \ - } else \ - debug_req(NULL, level, req, __FILE__, __func__, __LINE__, \ - "@@@ "fmt, ## args); \ +#define DEBUG_REQ(level, req, fmt, args...) \ +do { \ + if ((level) & (D_ERROR | D_WARNING)) { \ + static cfs_debug_limit_state_t cdls; \ + debug_req(&cdls, level, req, __FILE__, __func__, __LINE__, \ + "@@@ "fmt" ", ## args); \ + } else \ + debug_req(NULL, level, req, __FILE__, __func__, __LINE__, \ + "@@@ "fmt" ", ## args); \ } while (0) struct ptlrpc_bulk_page { diff --git a/lustre/llite/rw26.c b/lustre/llite/rw26.c index 4852d437abed18bd598010912cb3abaa2f80795d..4fb767f00cf43a880c3a2e85fe4380be63f6ed98 100644 --- a/lustre/llite/rw26.c +++ b/lustre/llite/rw26.c @@ -204,8 +204,8 @@ static ssize_t ll_direct_IO_26(int rw, struct kiocb *iocb, if ((file_offset & (~CFS_PAGE_MASK)) || (count & ~CFS_PAGE_MASK)) RETURN(-EINVAL); - CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p), size="LPSZ" (max "LPSZ - "), offset=%lld=%llx, pages "LPSZ" (max "LPSZ")\n", + CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p), size="LPSZ" (max %lu), " + "offset=%lld=%llx, pages "LPSZ" (max %lu)\n", inode->i_ino, inode->i_generation, inode, count, MAX_DIO_SIZE, file_offset, file_offset, count >> CFS_PAGE_SHIFT, MAX_DIO_SIZE >> CFS_PAGE_SHIFT); diff --git a/lustre/obdclass/llog_lvfs.c b/lustre/obdclass/llog_lvfs.c index 6c287b3cb5774c37121635a5b3e0ca7300f18e03..53260c5a0322b416b3265341462b0827016aeb71 100644 --- a/lustre/obdclass/llog_lvfs.c +++ b/lustre/obdclass/llog_lvfs.c @@ -267,8 +267,8 @@ static int llog_lvfs_write_rec(struct llog_handle *loghandle, "modify record "LPX64": idx:%d/%u/%d, len:%u " "offset %llu\n", loghandle->lgh_id.lgl_oid, idx, rec->lrh_index, - loghandle->lgh_cur_idx, - rec->lrh_len, saved_offset - sizeof(*llh)); + loghandle->lgh_cur_idx, rec->lrh_len, + (long long)(saved_offset - sizeof(*llh))); if (rec->lrh_index != loghandle->lgh_cur_idx) { CERROR("modify idx mismatch %u/%d\n", idx, loghandle->lgh_cur_idx); diff --git a/lustre/obdclass/obd_config.c b/lustre/obdclass/obd_config.c index cba4460dd3e37ee48880ef2bba42d46593d9c407..86bf7917cea11572fa39eef04778c068741ac23a 100644 --- a/lustre/obdclass/obd_config.c +++ b/lustre/obdclass/obd_config.c @@ -860,14 +860,14 @@ int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars, } if (!matched) { CERROR("%s: unknown param %s\n", - lustre_cfg_string(lcfg, 0), key); + (char *)lustre_cfg_string(lcfg, 0), key); rc = -EINVAL; /* continue parsing other params */ } else { LCONSOLE_INFO("%s.%.*s: set parameter %.*s=%s\n", - lustre_cfg_string(lcfg, 0), - strlen(prefix) - 1, prefix, - sval - key - 1, key, sval); + (char *)lustre_cfg_string(lcfg, 0), + (int)strlen(prefix) - 1, prefix, + (int)(sval - key - 1), key, sval); } } diff --git a/lustre/tests/test_brw.c b/lustre/tests/test_brw.c index d225b473f0d2e2db16d0c94b39799a845cf9826d..0e5605ec15a9f20f72c8de1fade4f40c66765fc5 100644 --- a/lustre/tests/test_brw.c +++ b/lustre/tests/test_brw.c @@ -81,7 +81,7 @@ int main(int argc, char **argv) { int fd; char *buf; - loff_t count, last, offset; + long long count, last, offset; long pg_vec, len; __u64 objid; struct stat st; @@ -152,8 +152,8 @@ int main(int argc, char **argv) objid = 3; } - printf("%s: %s on %s(objid "LPX64") for "LPSZ"x%ld pages \n", - argv[0], + printf("%s: %s on %s(objid "LPX64") for %llux%ld pages \n", + argv[0], #ifdef O_DIRECT flags & O_DIRECT ? "directio" : "i/o", #else