Hi Long, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on v4.17-rc6] [cannot apply to cifs/for-next next-20180601] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Long-Li/CIFS-Add-direct-I-O-support/20180602-130240 config: i386-randconfig-x008-201821 (attached as .config) compiler: gcc-7 (Debian 7.3.0-16) 7.3.0 reproduce: # save the attached .config to linux build tree make ARCH=i386 All warnings (new ones prefixed by >>): In file included from include/linux/kernel.h:14:0, from include/linux/list.h:9, from include/linux/wait.h:7, from include/linux/wait_bit.h:8, from include/linux/fs.h:6, from fs//cifs/file.c:24: fs//cifs/file.c: In function 'cifs_direct_readv': include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'size_t {aka unsigned int}' [-Wformat=] #define KERN_SOH "\001" /* ASCII Start Of Header */ ^ include/linux/printk.h:136:10: note: in definition of macro 'no_printk' printk(fmt, ##__VA_ARGS__); \ ^~~ include/linux/kern_levels.h:15:20: note: in expansion of macro 'KERN_SOH' #define KERN_DEBUG KERN_SOH "7" /* debug-level messages */ ^~~~~~~~ include/linux/printk.h:410:12: note: in expansion of macro 'KERN_DEBUG' no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~~~ fs//cifs/cifs_debug.h:54:3: note: in expansion of macro 'pr_debug_once' pr_debug_ ## ratefunc("%s: " \ ^~~~~~~~~ fs//cifs/cifs_debug.h:67:3: note: in expansion of macro 'cifs_dbg_func' cifs_dbg_func(once, \ ^~~~~~~~~~~~~ >> fs//cifs/file.c:3346:4: note: in expansion of macro 'cifs_dbg' cifs_dbg(VFS, ^~~~~~~~ fs//cifs/file.c:3348:20: note: format string is defined here " iov_offset %lu count %lu\n", ~~^ %u In file included from include/linux/kernel.h:14:0, from include/linux/list.h:9, from include/linux/wait.h:7, from include/linux/wait_bit.h:8, from include/linux/fs.h:6, from fs//cifs/file.c:24: include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'size_t {aka unsigned int}' [-Wformat=] #define KERN_SOH "\001" /* ASCII Start Of Header */ ^ include/linux/printk.h:136:10: note: in definition of macro 'no_printk' printk(fmt, ##__VA_ARGS__); \ ^~~ include/linux/kern_levels.h:15:20: note: in expansion of macro 'KERN_SOH' #define KERN_DEBUG KERN_SOH "7" /* debug-level messages */ ^~~~~~~~ include/linux/printk.h:410:12: note: in expansion of macro 'KERN_DEBUG' no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~~~ fs//cifs/cifs_debug.h:54:3: note: in expansion of macro 'pr_debug_once' pr_debug_ ## ratefunc("%s: " \ ^~~~~~~~~ fs//cifs/cifs_debug.h:67:3: note: in expansion of macro 'cifs_dbg_func' cifs_dbg_func(once, \ ^~~~~~~~~~~~~ >> fs//cifs/file.c:3346:4: note: in expansion of macro 'cifs_dbg' cifs_dbg(VFS, ^~~~~~~~ fs//cifs/file.c:3348:30: note: format string is defined here " iov_offset %lu count %lu\n", ~~^ %u In file included from include/linux/kernel.h:14:0, from include/linux/list.h:9, from include/linux/wait.h:7, from include/linux/wait_bit.h:8, from include/linux/fs.h:6, from fs//cifs/file.c:24: include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=] #define KERN_SOH "\001" /* ASCII Start Of Header */ ^ include/linux/printk.h:357:10: note: in definition of macro 'printk_once' printk(fmt, ##__VA_ARGS__); \ ^~~ include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH' #define KERN_ERR KERN_SOH "3" /* error conditions */ ^~~~~~~~ include/linux/printk.h:386:14: note: in expansion of macro 'KERN_ERR' printk_once(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~ fs//cifs/cifs_debug.h:57:3: note: in expansion of macro 'pr_err_once' pr_err_ ## ratefunc("CIFS VFS: " \ ^~~~~~~ fs//cifs/cifs_debug.h:67:3: note: in expansion of macro 'cifs_dbg_func' cifs_dbg_func(once, \ ^~~~~~~~~~~~~ >> fs//cifs/file.c:3346:4: note: in expansion of macro 'cifs_dbg' cifs_dbg(VFS, ^~~~~~~~ fs//cifs/file.c:3348:20: note: format string is defined here " iov_offset %lu count %lu\n", ~~^ %u In file included from include/linux/kernel.h:14:0, from include/linux/list.h:9, from include/linux/wait.h:7, from include/linux/wait_bit.h:8, from include/linux/fs.h:6, from fs//cifs/file.c:24: include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'size_t {aka unsigned int}' [-Wformat=] #define KERN_SOH "\001" /* ASCII Start Of Header */ ^ include/linux/printk.h:357:10: note: in definition of macro 'printk_once' printk(fmt, ##__VA_ARGS__); \ ^~~ include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH' #define KERN_ERR KERN_SOH "3" /* error conditions */ ^~~~~~~~ include/linux/printk.h:386:14: note: in expansion of macro 'KERN_ERR' printk_once(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~ fs//cifs/cifs_debug.h:57:3: note: in expansion of macro 'pr_err_once' pr_err_ ## ratefunc("CIFS VFS: " \ ^~~~~~~ fs//cifs/cifs_debug.h:67:3: note: in expansion of macro 'cifs_dbg_func' cifs_dbg_func(once, \ ^~~~~~~~~~~~~ >> fs//cifs/file.c:3346:4: note: in expansion of macro 'cifs_dbg' cifs_dbg(VFS, ^~~~~~~~ fs//cifs/file.c:3348:30: note: format string is defined here " iov_offset %lu count %lu\n", ~~^ %u In file included from include/linux/kernel.h:14:0, from include/linux/list.h:9, from include/linux/wait.h:7, from include/linux/wait_bit.h:8, from include/linux/fs.h:6, from fs//cifs/file.c:24: include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=] #define KERN_SOH "\001" /* ASCII Start Of Header */ ^ include/linux/printk.h:136:10: note: in definition of macro 'no_printk' printk(fmt, ##__VA_ARGS__); \ ^~~ include/linux/kern_levels.h:15:20: note: in expansion of macro 'KERN_SOH' #define KERN_DEBUG KERN_SOH "7" /* debug-level messages */ ^~~~~~~~ include/linux/printk.h:410:12: note: in expansion of macro 'KERN_DEBUG' no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~~~ fs//cifs/cifs_debug.h:60:3: note: in expansion of macro 'pr_debug_once' pr_debug_ ## ratefunc(fmt, ##__VA_ARGS__); \ ^~~~~~~~~ fs//cifs/cifs_debug.h:67:3: note: in expansion of macro 'cifs_dbg_func' cifs_dbg_func(once, \ ^~~~~~~~~~~~~ >> fs//cifs/file.c:3346:4: note: in expansion of macro 'cifs_dbg' cifs_dbg(VFS, ^~~~~~~~ fs//cifs/file.c:3348:20: note: format string is defined here " iov_offset %lu count %lu\n", ~~^ %u In file included from include/linux/kernel.h:14:0, from include/linux/list.h:9, from include/linux/wait.h:7, from include/linux/wait_bit.h:8, from include/linux/fs.h:6, from fs//cifs/file.c:24: include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'size_t {aka unsigned int}' [-Wformat=] #define KERN_SOH "\001" /* ASCII Start Of Header */ ^ include/linux/printk.h:136:10: note: in definition of macro 'no_printk' printk(fmt, ##__VA_ARGS__); \ ^~~ include/linux/kern_levels.h:15:20: note: in expansion of macro 'KERN_SOH' #define KERN_DEBUG KERN_SOH "7" /* debug-level messages */ ^~~~~~~~ include/linux/printk.h:410:12: note: in expansion of macro 'KERN_DEBUG' no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~~~ fs//cifs/cifs_debug.h:60:3: note: in expansion of macro 'pr_debug_once' pr_debug_ ## ratefunc(fmt, ##__VA_ARGS__); \ ^~~~~~~~~ fs//cifs/cifs_debug.h:67:3: note: in expansion of macro 'cifs_dbg_func' cifs_dbg_func(once, \ ^~~~~~~~~~~~~ >> fs//cifs/file.c:3346:4: note: in expansion of macro 'cifs_dbg' cifs_dbg(VFS, ^~~~~~~~ fs//cifs/file.c:3348:30: note: format string is defined here " iov_offset %lu count %lu\n", ~~^ %u In file included from include/linux/kernel.h:14:0, from include/linux/list.h:9, from include/linux/wait.h:7, from include/linux/wait_bit.h:8, from include/linux/fs.h:6, from fs//cifs/file.c:24: include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'size_t {aka unsigned int}' [-Wformat=] #define KERN_SOH "\001" /* ASCII Start Of Header */ ^ include/linux/printk.h:136:10: note: in definition of macro 'no_printk' printk(fmt, ##__VA_ARGS__); \ ^~~ include/linux/kern_levels.h:15:20: note: in expansion of macro 'KERN_SOH' #define KERN_DEBUG KERN_SOH "7" /* debug-level messages */ ^~~~~~~~ include/linux/printk.h:474:12: note: in expansion of macro 'KERN_DEBUG' no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~~~ fs//cifs/cifs_debug.h:54:3: note: in expansion of macro 'pr_debug_ratelimited' pr_debug_ ## ratefunc("%s: " \ ^~~~~~~~~ fs//cifs/cifs_debug.h:70:3: note: in expansion of macro 'cifs_dbg_func' cifs_dbg_func(ratelimited, \ ^~~~~~~~~~~~~ >> fs//cifs/file.c:3346:4: note: in expansion of macro 'cifs_dbg' cifs_dbg(VFS, ^~~~~~~~ fs//cifs/file.c:3348:20: note: format string is defined here " iov_offset %lu count %lu\n", ~~^ %u In file included from include/linux/kernel.h:14:0, from include/linux/list.h:9, from include/linux/wait.h:7, from include/linux/wait_bit.h:8, from include/linux/fs.h:6, from fs//cifs/file.c:24: include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'size_t {aka unsigned int}' [-Wformat=] #define KERN_SOH "\001" /* ASCII Start Of Header */ ^ include/linux/printk.h:136:10: note: in definition of macro 'no_printk' printk(fmt, ##__VA_ARGS__); \ ^~~ include/linux/kern_levels.h:15:20: note: in expansion of macro 'KERN_SOH' #define KERN_DEBUG KERN_SOH "7" /* debug-level messages */ ^~~~~~~~ include/linux/printk.h:474:12: note: in expansion of macro 'KERN_DEBUG' no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~~~ fs//cifs/cifs_debug.h:54:3: note: in expansion of macro 'pr_debug_ratelimited' pr_debug_ ## ratefunc("%s: " \ ^~~~~~~~~ fs//cifs/cifs_debug.h:70:3: note: in expansion of macro 'cifs_dbg_func' cifs_dbg_func(ratelimited, \ ^~~~~~~~~~~~~ >> fs//cifs/file.c:3346:4: note: in expansion of macro 'cifs_dbg' cifs_dbg(VFS, ^~~~~~~~ fs//cifs/file.c:3348:30: note: format string is defined here " iov_offset %lu count %lu\n", ~~^ %u In file included from include/linux/kernel.h:14:0, from include/linux/list.h:9, from include/linux/wait.h:7, from include/linux/wait_bit.h:8, from include/linux/fs.h:6, from fs//cifs/file.c:24: include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=] #define KERN_SOH "\001" /* ASCII Start Of Header */ ^ include/linux/printk.h:425:10: note: in definition of macro 'printk_ratelimited' printk(fmt, ##__VA_ARGS__); \ ^~~ include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH' #define KERN_ERR KERN_SOH "3" /* error conditions */ ^~~~~~~~ include/linux/printk.h:439:21: note: in expansion of macro 'KERN_ERR' printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~ fs//cifs/cifs_debug.h:57:3: note: in expansion of macro 'pr_err_ratelimited' pr_err_ ## ratefunc("CIFS VFS: " \ ^~~~~~~ fs//cifs/cifs_debug.h:70:3: note: in expansion of macro 'cifs_dbg_func' cifs_dbg_func(ratelimited, \ ^~~~~~~~~~~~~ >> fs//cifs/file.c:3346:4: note: in expansion of macro 'cifs_dbg' cifs_dbg(VFS, ^~~~~~~~ fs//cifs/file.c:3348:20: note: format string is defined here " iov_offset %lu count %lu\n", ~~^ %u In file included from include/linux/kernel.h:14:0, from include/linux/list.h:9, from include/linux/wait.h:7, from include/linux/wait_bit.h:8, from include/linux/fs.h:6, from fs//cifs/file.c:24: include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'size_t {aka unsigned int}' [-Wformat=] #define KERN_SOH "\001" /* ASCII Start Of Header */ ^ include/linux/printk.h:425:10: note: in definition of macro 'printk_ratelimited' printk(fmt, ##__VA_ARGS__); \ ^~~ include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH' #define KERN_ERR KERN_SOH "3" /* error conditions */ ^~~~~~~~ include/linux/printk.h:439:21: note: in expansion of macro 'KERN_ERR' printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~ fs//cifs/cifs_debug.h:57:3: note: in expansion of macro 'pr_err_ratelimited' pr_err_ ## ratefunc("CIFS VFS: " \ ^~~~~~~ fs//cifs/cifs_debug.h:70:3: note: in expansion of macro 'cifs_dbg_func' cifs_dbg_func(ratelimited, \ ^~~~~~~~~~~~~ >> fs//cifs/file.c:3346:4: note: in expansion of macro 'cifs_dbg' cifs_dbg(VFS, ^~~~~~~~ fs//cifs/file.c:3348:30: note: format string is defined here " iov_offset %lu count %lu\n", ~~^ %u In file included from include/linux/kernel.h:14:0, from include/linux/list.h:9, from include/linux/wait.h:7, from include/linux/wait_bit.h:8, from include/linux/fs.h:6, from fs//cifs/file.c:24: include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=] #define KERN_SOH "\001" /* ASCII Start Of Header */ ^ include/linux/printk.h:136:10: note: in definition of macro 'no_printk' printk(fmt, ##__VA_ARGS__); \ ^~~ include/linux/kern_levels.h:15:20: note: in expansion of macro 'KERN_SOH' #define KERN_DEBUG KERN_SOH "7" /* debug-level messages */ ^~~~~~~~ include/linux/printk.h:474:12: note: in expansion of macro 'KERN_DEBUG' no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~~~ fs//cifs/cifs_debug.h:60:3: note: in expansion of macro 'pr_debug_ratelimited' pr_debug_ ## ratefunc(fmt, ##__VA_ARGS__); \ ^~~~~~~~~ fs//cifs/cifs_debug.h:70:3: note: in expansion of macro 'cifs_dbg_func' cifs_dbg_func(ratelimited, \ ^~~~~~~~~~~~~ >> fs//cifs/file.c:3346:4: note: in expansion of macro 'cifs_dbg' cifs_dbg(VFS, ^~~~~~~~ fs//cifs/file.c:3348:20: note: format string is defined here " iov_offset %lu count %lu\n", ~~^ %u In file included from include/linux/kernel.h:14:0, from include/linux/list.h:9, from include/linux/wait.h:7, from include/linux/wait_bit.h:8, from include/linux/fs.h:6, from fs//cifs/file.c:24: include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'size_t {aka unsigned int}' [-Wformat=] #define KERN_SOH "\001" /* ASCII Start Of Header */ ^ include/linux/printk.h:136:10: note: in definition of macro 'no_printk' printk(fmt, ##__VA_ARGS__); \ ^~~ include/linux/kern_levels.h:15:20: note: in expansion of macro 'KERN_SOH' #define KERN_DEBUG KERN_SOH "7" /* debug-level messages */ ^~~~~~~~ include/linux/printk.h:474:12: note: in expansion of macro 'KERN_DEBUG' no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~~~ fs//cifs/cifs_debug.h:60:3: note: in expansion of macro 'pr_debug_ratelimited' pr_debug_ ## ratefunc(fmt, ##__VA_ARGS__); \ ^~~~~~~~~ fs//cifs/cifs_debug.h:70:3: note: in expansion of macro 'cifs_dbg_func' cifs_dbg_func(ratelimited, \ ^~~~~~~~~~~~~ >> fs//cifs/file.c:3346:4: note: in expansion of macro 'cifs_dbg' cifs_dbg(VFS, ^~~~~~~~ fs//cifs/file.c:3348:30: note: format string is defined here " iov_offset %lu count %lu\n", ~~^ %u vim +/cifs_dbg +3346 fs//cifs/file.c 3290 3291 ssize_t cifs_direct_readv(struct kiocb *iocb, struct iov_iter *to) 3292 { 3293 size_t len, cur_len, start; 3294 unsigned int npages, rsize, credits; 3295 struct file *file; 3296 struct cifs_sb_info *cifs_sb; 3297 struct cifsFileInfo *cfile; 3298 struct cifs_tcon *tcon; 3299 struct page **pagevec; 3300 ssize_t rc, total_read = 0; 3301 struct TCP_Server_Info *server; 3302 loff_t offset = iocb->ki_pos; 3303 pid_t pid; 3304 struct cifs_readdata *rdata; 3305 3306 /* 3307 * iov_iter_get_pages_alloc() doesn't work with ITER_KVEC, 3308 * fall back to data copy read path 3309 */ 3310 if (to->type & ITER_KVEC) { 3311 cifs_dbg(FYI, "use non-direct cifs_user_readv for kvec I/O\n"); 3312 return cifs_user_readv(iocb, to); 3313 } 3314 3315 len = iov_iter_count(to); 3316 if (!len) 3317 return 0; 3318 3319 file = iocb->ki_filp; 3320 cifs_sb = CIFS_FILE_SB(file); 3321 cfile = file->private_data; 3322 tcon = tlink_tcon(cfile->tlink); 3323 server = tcon->ses->server; 3324 3325 if (!server->ops->async_readv) 3326 return -ENOSYS; 3327 3328 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RWPIDFORWARD) 3329 pid = cfile->pid; 3330 else 3331 pid = current->tgid; 3332 3333 if ((file->f_flags & O_ACCMODE) == O_WRONLY) 3334 cifs_dbg(FYI, "attempting read on write only file instance\n"); 3335 3336 do { 3337 rc = server->ops->wait_mtu_credits(server, cifs_sb->rsize, 3338 &rsize, &credits); 3339 if (rc) 3340 break; 3341 3342 cur_len = min_t(const size_t, len, rsize); 3343 3344 rc = iov_iter_get_pages_alloc(to, &pagevec, cur_len, &start); 3345 if (rc < 0) { > 3346 cifs_dbg(VFS, 3347 "couldn't get user pages (rc=%zd) iter type %d" 3348 " iov_offset %lu count %lu\n", 3349 rc, to->type, to->iov_offset, to->count); 3350 dump_stack(); 3351 break; 3352 } 3353 3354 rdata = cifs_readdata_direct_alloc( 3355 pagevec, cifs_direct_readv_complete); 3356 if (!rdata) { 3357 add_credits_and_wake_if(server, credits, 0); 3358 rc = -ENOMEM; 3359 break; 3360 } 3361 3362 npages = (rc + start + PAGE_SIZE-1) / PAGE_SIZE; 3363 rdata->nr_pages = npages; 3364 rdata->page_offset = start; 3365 rdata->pagesz = PAGE_SIZE; 3366 rdata->tailsz = npages > 1 ? 3367 rc-(PAGE_SIZE-start)-(npages-2)*PAGE_SIZE : 3368 rc; 3369 cur_len = rc; 3370 3371 rdata->cfile = cifsFileInfo_get(cfile); 3372 rdata->offset = offset; 3373 rdata->bytes = rc; 3374 rdata->pid = pid; 3375 rdata->read_into_pages = cifs_uncached_read_into_pages; 3376 rdata->copy_into_pages = cifs_uncached_copy_into_pages; 3377 rdata->credits = credits; 3378 3379 rc = 0; 3380 if (rdata->cfile->invalidHandle) 3381 rc = cifs_reopen_file(rdata->cfile, true); 3382 3383 if (!rc) 3384 rc = server->ops->async_readv(rdata); 3385 3386 if (rc) { 3387 add_credits_and_wake_if(server, rdata->credits, 0); 3388 kref_put(&rdata->refcount, 3389 cifs_direct_readdata_release); 3390 if (rc == -EAGAIN) 3391 continue; 3392 break; 3393 } 3394 3395 wait_for_completion(&rdata->done); 3396 rc = rdata->result; 3397 if (rc) { 3398 kref_put( 3399 &rdata->refcount, 3400 cifs_direct_readdata_release); 3401 if (rc == -EAGAIN) 3402 continue; 3403 break; 3404 } 3405 3406 total_read += rdata->got_bytes; 3407 kref_put(&rdata->refcount, cifs_direct_readdata_release); 3408 3409 iov_iter_advance(to, cur_len); 3410 len -= cur_len; 3411 offset += cur_len; 3412 } while (len); 3413 3414 iocb->ki_pos += total_read; 3415 3416 return total_read; 3417 } 3418 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip