From: kernel test robot <lkp@intel.com>
To: David Howells <dhowells@redhat.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [dhowells-fs:ceph-iter 105/105] fs/ceph/crypto.c:644:42: error: 'op' undeclared; did you mean 'up'?
Date: Fri, 19 Jan 2024 22:36:07 +0800 [thread overview]
Message-ID: <202401192255.PDG6e4s5-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git ceph-iter
head: 2cf82c6e7baf6d3a2adc0692707028da395f1553
commit: 2cf82c6e7baf6d3a2adc0692707028da395f1553 [105/105] ceph: Use netfslib
config: i386-randconfig-141-20240117 (https://download.01.org/0day-ci/archive/20240119/202401192255.PDG6e4s5-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240119/202401192255.PDG6e4s5-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401192255.PDG6e4s5-lkp@intel.com/
All errors (new ones prefixed by >>):
fs/ceph/crypto.c:545:5: warning: no previous prototype for 'ceph_fscrypt_decrypt_pages' [-Wmissing-prototypes]
545 | int ceph_fscrypt_decrypt_pages(struct inode *inode, struct ceph_databuf *dbuf,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ceph/crypto.c:591:5: error: conflicting types for 'ceph_fscrypt_decrypt_extents'; have 'int(struct inode *, struct page **, u64, struct ceph_sparse_extent *, u32)' {aka 'int(struct inode *, struct page **, long long unsigned int, struct ceph_sparse_extent *, unsigned int)'}
591 | int ceph_fscrypt_decrypt_extents(struct inode *inode, struct page **page,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from fs/ceph/super.h:25,
from fs/ceph/crypto.c:14:
fs/ceph/crypto.h:160:5: note: previous declaration of 'ceph_fscrypt_decrypt_extents' with type 'int(struct inode *, struct ceph_databuf *, u64, struct ceph_sparse_extent *, u32)' {aka 'int(struct inode *, struct ceph_databuf *, long long unsigned int, struct ceph_sparse_extent *, unsigned int)'}
160 | int ceph_fscrypt_decrypt_extents(struct inode *inode, struct ceph_databuf *dbuf, u64 off,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ceph/crypto.c: In function 'ceph_fscrypt_decrypt_extents':
fs/ceph/crypto.c:625:58: error: passing argument 2 of 'ceph_fscrypt_decrypt_pages' from incompatible pointer type [-Werror=incompatible-pointer-types]
625 | fret = ceph_fscrypt_decrypt_pages(inode, &page[pgidx],
| ^~~~~~~~~~~~
| |
| struct page **
fs/ceph/crypto.c:545:74: note: expected 'struct ceph_databuf *' but argument is of type 'struct page **'
545 | int ceph_fscrypt_decrypt_pages(struct inode *inode, struct ceph_databuf *dbuf,
| ~~~~~~~~~~~~~~~~~~~~~^~~~
fs/ceph/crypto.c: At top level:
fs/ceph/crypto.c:640:5: warning: no previous prototype for 'ceph_decrypt_block' [-Wmissing-prototypes]
640 | int ceph_decrypt_block(struct netfs_io_request *rreq, loff_t pos, size_t len,
| ^~~~~~~~~~~~~~~~~~
fs/ceph/crypto.c: In function 'ceph_decrypt_block':
>> fs/ceph/crypto.c:644:42: error: 'op' undeclared (first use in this function); did you mean 'up'?
644 | struct ceph_sparse_extent *map = op->extent.sparse_ext;
| ^~
| up
fs/ceph/crypto.c:644:42: note: each undeclared identifier is reported only once for each function it appears in
>> fs/ceph/crypto.c:645:49: error: 'inode' undeclared (first use in this function)
645 | struct ceph_inode_info *ci = ceph_inode(inode);
| ^~~~~
>> fs/ceph/crypto.c:671:59: error: 'page' undeclared (first use in this function)
671 | fret = ceph_fscrypt_decrypt_pages(inode, &page[pgidx],
| ^~~~
>> fs/ceph/crypto.c:672:50: error: 'off' undeclared (first use in this function)
672 | off + pgsoff, ext->len);
| ^~~
fs/ceph/crypto.c:663:21: warning: variable 'pgidx' set but not used [-Wunused-but-set-variable]
663 | int pgidx = pgsoff >> PAGE_SHIFT;
| ^~~~~
fs/ceph/crypto.c: At top level:
fs/ceph/crypto.c:686:5: warning: no previous prototype for 'ceph_encrypt_block' [-Wmissing-prototypes]
686 | int ceph_encrypt_block(struct netfs_io_request *wreq, loff_t pos, size_t len,
| ^~~~~~~~~~~~~~~~~~
fs/ceph/crypto.c: In function 'ceph_encrypt_block':
fs/ceph/crypto.c:690:1: warning: control reaches end of non-void function [-Wreturn-type]
690 | }
| ^
cc1: some warnings being treated as errors
--
fs/ceph/file.c: In function 'ceph_write_terminated':
>> fs/ceph/file.c:1664:41: error: 'len' undeclared (first use in this function)
1664 | netfs_subreq_terminated(subreq, len, err);
| ^~~
fs/ceph/file.c:1664:41: note: each undeclared identifier is reported only once for each function it appears in
fs/ceph/file.c: In function 'ceph_create_write_requests':
>> fs/ceph/file.c:1761:39: error: passing argument 1 of 'ceph_upload_to_server' from incompatible pointer type [-Werror=incompatible-pointer-types]
1761 | ceph_upload_to_server(req);
| ^~~
| |
| struct ceph_osd_request *
fs/ceph/file.c:1667:63: note: expected 'struct netfs_io_subrequest *' but argument is of type 'struct ceph_osd_request *'
1667 | static void ceph_upload_to_server(struct netfs_io_subrequest *subreq)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
fs/ceph/file.c: At top level:
fs/ceph/file.c:1629:13: warning: 'ceph_write_terminated' defined but not used [-Wunused-function]
1629 | static void ceph_write_terminated(struct netfs_io_subrequest *subreq, int err)
| ^~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
--
fs/ceph/addr.c: In function 'get_oldest_context':
fs/ceph/addr.c:547:1: warning: label 'out' defined but not used [-Wunused-label]
547 | out:
| ^~~
fs/ceph/addr.c: In function 'ceph_page_mkwrite':
>> fs/ceph/addr.c:901:44: error: 'struct ceph_inode_info' has no member named 'head_snapc'; did you mean 'i_head_snapc'?
901 | return netfs_page_mkwrite(vmf, ci->head_snapc);
| ^~~~~~~~~~
| i_head_snapc
fs/ceph/addr.c:897:35: warning: unused variable 'snapc' [-Wunused-variable]
897 | struct ceph_snap_context *snapc;
| ^~~~~
fs/ceph/addr.c: At top level:
fs/ceph/addr.c:66:12: warning: 'ceph_netfs_check_write_begin' used but never defined
66 | static int ceph_netfs_check_write_begin(struct file *file, loff_t pos, unsigned int len,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ceph/addr.c: In function 'ceph_page_mkwrite':
fs/ceph/addr.c:902:1: warning: control reaches end of non-void function [-Wreturn-type]
902 | }
| ^
fs/ceph/addr.c: At top level:
fs/ceph/addr.c:69:34: warning: 'folio_snap_context' defined but not used [-Wunused-function]
69 | static struct ceph_snap_context *folio_snap_context(struct folio *folio)
| ^~~~~~~~~~~~~~~~~~
vim +644 fs/ceph/crypto.c
529
530 /**
531 * ceph_fscrypt_decrypt_data - Decrypt buffered data
532 * @inode: pointer to inode associated with these pages
533 * @dbuf: pointer to buffer containing the data
534 * @off: offset into the file that the read data starts
535 * @len: max length to decrypt
536 *
537 * Decrypt an buffer of fscrypt'ed pages and return the amount of
538 * data decrypted. Any data in the page prior to the start of the
539 * first complete block in the read is ignored. Any incomplete
540 * crypto blocks at the end of the array are ignored (and should
541 * probably be zeroed by the caller).
542 *
543 * Returns the length of the decrypted data or a negative errno.
544 */
> 545 int ceph_fscrypt_decrypt_pages(struct inode *inode, struct ceph_databuf *dbuf,
546 u64 off, int len)
547 {
548 int i, num_blocks;
549 u64 baseblk = off >> CEPH_FSCRYPT_BLOCK_SHIFT;
550 int ret = 0;
551
552 /*
553 * We can't deal with partial blocks on an encrypted file, so mask off
554 * the last bit.
555 */
556 num_blocks = ceph_fscrypt_blocks(off, len & CEPH_FSCRYPT_BLOCK_MASK);
557
558 /* Decrypt each block */
559 for (i = 0; i < num_blocks; ++i) {
560 int blkoff = i << CEPH_FSCRYPT_BLOCK_SHIFT;
561 int pgidx = blkoff >> PAGE_SHIFT;
562 unsigned int pgoffs = offset_in_page(blkoff);
563 int fret;
564
565 fret = ceph_fscrypt_decrypt_block_inplace(inode,
566 ceph_databuf_page(dbuf, pgidx),
567 CEPH_FSCRYPT_BLOCK_SIZE, pgoffs,
568 baseblk + i);
569 if (fret < 0) {
570 if (ret == 0)
571 ret = fret;
572 break;
573 }
574 ret += CEPH_FSCRYPT_BLOCK_SIZE;
575 }
576 return ret;
577 }
578
579 /**
580 * ceph_fscrypt_decrypt_extents: decrypt received extents in given buffer
581 * @inode: inode associated with pages being decrypted
582 * @page: pointer to page array
583 * @off: offset into the file that the data in page[0] starts
584 * @map: pointer to extent array
585 * @ext_cnt: length of extent array
586 *
587 * Given an extent map and a page array, decrypt the received data in-place,
588 * skipping holes. Returns the offset into buffer of end of last decrypted
589 * block.
590 */
591 int ceph_fscrypt_decrypt_extents(struct inode *inode, struct page **page,
592 u64 off, struct ceph_sparse_extent *map,
593 u32 ext_cnt)
594 {
595 struct ceph_client *cl = ceph_inode_to_client(inode);
596 int i, ret = 0;
597 struct ceph_inode_info *ci = ceph_inode(inode);
598 u64 objno, objoff;
599 u32 xlen;
600
601 /* Nothing to do for empty array */
602 if (ext_cnt == 0) {
603 doutc(cl, "%p %llx.%llx empty array, ret 0\n", inode,
604 ceph_vinop(inode));
605 return 0;
606 }
607
608 ceph_calc_file_object_mapping(&ci->i_layout, off, map[0].len,
609 &objno, &objoff, &xlen);
610
611 for (i = 0; i < ext_cnt; ++i) {
612 struct ceph_sparse_extent *ext = &map[i];
613 int pgsoff = ext->off - objoff;
614 int pgidx = pgsoff >> PAGE_SHIFT;
615 int fret;
616
617 if ((ext->off | ext->len) & ~CEPH_FSCRYPT_BLOCK_MASK) {
618 pr_warn_client(cl,
619 "%p %llx.%llx bad encrypted sparse extent "
620 "idx %d off %llx len %llx\n",
621 inode, ceph_vinop(inode), i, ext->off,
622 ext->len);
623 return -EIO;
624 }
625 fret = ceph_fscrypt_decrypt_pages(inode, &page[pgidx],
626 off + pgsoff, ext->len);
627 doutc(cl, "%p %llx.%llx [%d] 0x%llx~0x%llx fret %d\n", inode,
628 ceph_vinop(inode), i, ext->off, ext->len, fret);
629 if (fret < 0) {
630 if (ret == 0)
631 ret = fret;
632 break;
633 }
634 ret = pgsoff + fret;
635 }
636 doutc(cl, "ret %d\n", ret);
637 return ret;
638 }
639
> 640 int ceph_decrypt_block(struct netfs_io_request *rreq, loff_t pos, size_t len,
641 struct scatterlist *source_sg, unsigned int n_source,
642 struct scatterlist *dest_sg, unsigned int n_dest)
643 {
> 644 struct ceph_sparse_extent *map = op->extent.sparse_ext;
> 645 struct ceph_inode_info *ci = ceph_inode(inode);
646 u64 objno, objoff;
647 u32 ext_cnt = op->extent.sparse_ext_cnt;
648 u32 xlen;
649 int i, ret = 0;
650
651 /* Nothing to do for empty array */
652 if (ext_cnt == 0) {
653 dout("%s: empty array, ret 0\n", __func__);
654 return 0;
655 }
656
657 ceph_calc_file_object_mapping(&ci->i_layout, pos, map[0].len,
658 &objno, &objoff, &xlen);
659
660 for (i = 0; i < ext_cnt; ++i) {
661 struct ceph_sparse_extent *ext = &map[i];
662 int pgsoff = ext->off - objoff;
663 int pgidx = pgsoff >> PAGE_SHIFT;
664 int fret;
665
666 if ((ext->off | ext->len) & ~CEPH_FSCRYPT_BLOCK_MASK) {
667 pr_warn("%s: bad encrypted sparse extent idx %d off %llx len %llx\n",
668 __func__, i, ext->off, ext->len);
669 return -EIO;
670 }
> 671 fret = ceph_fscrypt_decrypt_pages(inode, &page[pgidx],
> 672 off + pgsoff, ext->len);
673 dout("%s: [%d] 0x%llx~0x%llx fret %d\n", __func__, i,
674 ext->off, ext->len, fret);
675 if (fret < 0) {
676 if (ret == 0)
677 ret = fret;
678 break;
679 }
680 ret = pgsoff + fret;
681 }
682 dout("%s: ret %d\n", __func__, ret);
683 return ret;
684 }
685
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-01-19 14:37 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202401192255.PDG6e4s5-lkp@intel.com \
--to=lkp@intel.com \
--cc=dhowells@redhat.com \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.