Re: [PATCH] fscrypt: Restore modular support
From: kbuild test robot
Date: Tue Dec 24 2019 - 06:59:20 EST
Hi Herbert,
I love your patch! Yet something to improve:
[auto build test ERROR on linux/master]
[cannot apply to ext4/dev f2fs/dev-test linus/master tytso-fscrypt/master v5.5-rc3 next-20191220]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Herbert-Xu/fscrypt-Restore-modular-support/20191224-164226
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 1522d9da40bdfe502c91163e6d769332897201fa
config: x86_64-rhel (attached as .config)
compiler: gcc-7 (Debian 7.5.0-3) 7.5.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>
All errors (new ones prefixed by >>):
ld: fs/super.o: in function `__put_super':
fs/super.c:296: undefined reference to `fscrypt_sb_free'
ld: fs/ext4/dir.o: in function `ext4_dir_open':
>> fs/ext4/dir.c:617: undefined reference to `fscrypt_get_encryption_info'
ld: fs/ext4/dir.o: in function `ext4_readdir':
fs/ext4/dir.c:118: undefined reference to `fscrypt_get_encryption_info'
>> ld: fs/ext4/dir.c:263: undefined reference to `fscrypt_fname_disk_to_usr'
>> ld: fs/ext4/dir.c:288: undefined reference to `fscrypt_fname_free_buffer'
>> ld: fs/ext4/dir.c:288: undefined reference to `fscrypt_fname_free_buffer'
>> ld: fs/ext4/dir.c:288: undefined reference to `fscrypt_fname_free_buffer'
>> ld: fs/ext4/dir.c:145: undefined reference to `fscrypt_fname_alloc_buffer'
>> ld: fs/ext4/dir.c:288: undefined reference to `fscrypt_fname_free_buffer'
>> ld: fs/ext4/dir.c:288: undefined reference to `fscrypt_fname_free_buffer'
ld: fs/ext4/file.o: in function `ext4_file_open':
>> fs/ext4/file.c:716: undefined reference to `fscrypt_file_open'
ld: fs/ext4/ialloc.o: in function `__ext4_new_inode':
>> fs/ext4/ialloc.c:772: undefined reference to `fscrypt_get_encryption_info'
>> ld: fs/ext4/ialloc.c:1145: undefined reference to `fscrypt_inherit_context'
ld: fs/ext4/inode.o: in function `ext4_block_write_begin':
>> fs/ext4/inode.c:1097: undefined reference to `fscrypt_decrypt_pagecache_blocks'
ld: fs/ext4/inode.o: in function `__ext4_block_zero_page_range':
fs/ext4/inode.c:3704: undefined reference to `fscrypt_decrypt_pagecache_blocks'
ld: fs/ext4/inode.o: in function `fscrypt_require_key':
>> include/linux/fscrypt.h:548: undefined reference to `fscrypt_get_encryption_info'
ld: fs/ext4/inode.o: in function `ext4_issue_zeroout':
>> fs/ext4/inode.c:406: undefined reference to `fscrypt_zeroout_range'
ld: fs/ext4/ioctl.o: in function `ext4_ioctl':
>> fs/ext4/ioctl.c:1141: undefined reference to `fscrypt_ioctl_set_policy'
>> ld: fs/ext4/ioctl.c:1211: undefined reference to `fscrypt_ioctl_get_key_status'
>> ld: fs/ext4/ioctl.c:1186: undefined reference to `fscrypt_ioctl_get_policy'
>> ld: fs/ext4/ioctl.c:1206: undefined reference to `fscrypt_ioctl_remove_key_all_users'
>> ld: fs/ext4/ioctl.c:1201: undefined reference to `fscrypt_ioctl_remove_key'
>> ld: fs/ext4/ioctl.c:1196: undefined reference to `fscrypt_ioctl_add_key'
vim +1097 fs/ext4/inode.c
ac27a0ec112a08 Dave Kleikamp 2006-10-11 1013
643fa9612bf1a2 Chandan Rajendra 2018-12-12 1014 #ifdef CONFIG_FS_ENCRYPTION
2058f83a728adf Michael Halcrow 2015-04-12 1015 static int ext4_block_write_begin(struct page *page, loff_t pos, unsigned len,
2058f83a728adf Michael Halcrow 2015-04-12 1016 get_block_t *get_block)
2058f83a728adf Michael Halcrow 2015-04-12 1017 {
09cbfeaf1a5a67 Kirill A. Shutemov 2016-04-01 1018 unsigned from = pos & (PAGE_SIZE - 1);
2058f83a728adf Michael Halcrow 2015-04-12 1019 unsigned to = from + len;
2058f83a728adf Michael Halcrow 2015-04-12 1020 struct inode *inode = page->mapping->host;
2058f83a728adf Michael Halcrow 2015-04-12 1021 unsigned block_start, block_end;
2058f83a728adf Michael Halcrow 2015-04-12 1022 sector_t block;
2058f83a728adf Michael Halcrow 2015-04-12 1023 int err = 0;
2058f83a728adf Michael Halcrow 2015-04-12 1024 unsigned blocksize = inode->i_sb->s_blocksize;
2058f83a728adf Michael Halcrow 2015-04-12 1025 unsigned bbits;
0b578f358a6a7a Chandan Rajendra 2019-05-20 1026 struct buffer_head *bh, *head, *wait[2];
0b578f358a6a7a Chandan Rajendra 2019-05-20 1027 int nr_wait = 0;
0b578f358a6a7a Chandan Rajendra 2019-05-20 1028 int i;
2058f83a728adf Michael Halcrow 2015-04-12 1029
2058f83a728adf Michael Halcrow 2015-04-12 1030 BUG_ON(!PageLocked(page));
09cbfeaf1a5a67 Kirill A. Shutemov 2016-04-01 1031 BUG_ON(from > PAGE_SIZE);
09cbfeaf1a5a67 Kirill A. Shutemov 2016-04-01 1032 BUG_ON(to > PAGE_SIZE);
2058f83a728adf Michael Halcrow 2015-04-12 1033 BUG_ON(from > to);
2058f83a728adf Michael Halcrow 2015-04-12 1034
2058f83a728adf Michael Halcrow 2015-04-12 1035 if (!page_has_buffers(page))
2058f83a728adf Michael Halcrow 2015-04-12 1036 create_empty_buffers(page, blocksize, 0);
2058f83a728adf Michael Halcrow 2015-04-12 1037 head = page_buffers(page);
2058f83a728adf Michael Halcrow 2015-04-12 1038 bbits = ilog2(blocksize);
09cbfeaf1a5a67 Kirill A. Shutemov 2016-04-01 1039 block = (sector_t)page->index << (PAGE_SHIFT - bbits);
2058f83a728adf Michael Halcrow 2015-04-12 1040
2058f83a728adf Michael Halcrow 2015-04-12 1041 for (bh = head, block_start = 0; bh != head || !block_start;
2058f83a728adf Michael Halcrow 2015-04-12 1042 block++, block_start = block_end, bh = bh->b_this_page) {
2058f83a728adf Michael Halcrow 2015-04-12 1043 block_end = block_start + blocksize;
2058f83a728adf Michael Halcrow 2015-04-12 1044 if (block_end <= from || block_start >= to) {
2058f83a728adf Michael Halcrow 2015-04-12 1045 if (PageUptodate(page)) {
2058f83a728adf Michael Halcrow 2015-04-12 1046 if (!buffer_uptodate(bh))
2058f83a728adf Michael Halcrow 2015-04-12 1047 set_buffer_uptodate(bh);
2058f83a728adf Michael Halcrow 2015-04-12 1048 }
2058f83a728adf Michael Halcrow 2015-04-12 1049 continue;
2058f83a728adf Michael Halcrow 2015-04-12 1050 }
2058f83a728adf Michael Halcrow 2015-04-12 1051 if (buffer_new(bh))
2058f83a728adf Michael Halcrow 2015-04-12 1052 clear_buffer_new(bh);
2058f83a728adf Michael Halcrow 2015-04-12 1053 if (!buffer_mapped(bh)) {
2058f83a728adf Michael Halcrow 2015-04-12 1054 WARN_ON(bh->b_size != blocksize);
2058f83a728adf Michael Halcrow 2015-04-12 1055 err = get_block(inode, block, bh, 1);
2058f83a728adf Michael Halcrow 2015-04-12 1056 if (err)
2058f83a728adf Michael Halcrow 2015-04-12 1057 break;
2058f83a728adf Michael Halcrow 2015-04-12 1058 if (buffer_new(bh)) {
2058f83a728adf Michael Halcrow 2015-04-12 1059 if (PageUptodate(page)) {
2058f83a728adf Michael Halcrow 2015-04-12 1060 clear_buffer_new(bh);
2058f83a728adf Michael Halcrow 2015-04-12 1061 set_buffer_uptodate(bh);
2058f83a728adf Michael Halcrow 2015-04-12 1062 mark_buffer_dirty(bh);
2058f83a728adf Michael Halcrow 2015-04-12 1063 continue;
2058f83a728adf Michael Halcrow 2015-04-12 1064 }
2058f83a728adf Michael Halcrow 2015-04-12 1065 if (block_end > to || block_start < from)
2058f83a728adf Michael Halcrow 2015-04-12 1066 zero_user_segments(page, to, block_end,
2058f83a728adf Michael Halcrow 2015-04-12 1067 block_start, from);
2058f83a728adf Michael Halcrow 2015-04-12 1068 continue;
2058f83a728adf Michael Halcrow 2015-04-12 1069 }
2058f83a728adf Michael Halcrow 2015-04-12 1070 }
2058f83a728adf Michael Halcrow 2015-04-12 1071 if (PageUptodate(page)) {
2058f83a728adf Michael Halcrow 2015-04-12 1072 if (!buffer_uptodate(bh))
2058f83a728adf Michael Halcrow 2015-04-12 1073 set_buffer_uptodate(bh);
2058f83a728adf Michael Halcrow 2015-04-12 1074 continue;
2058f83a728adf Michael Halcrow 2015-04-12 1075 }
2058f83a728adf Michael Halcrow 2015-04-12 1076 if (!buffer_uptodate(bh) && !buffer_delay(bh) &&
2058f83a728adf Michael Halcrow 2015-04-12 1077 !buffer_unwritten(bh) &&
2058f83a728adf Michael Halcrow 2015-04-12 1078 (block_start < from || block_end > to)) {
dfec8a14fc9043 Mike Christie 2016-06-05 1079 ll_rw_block(REQ_OP_READ, 0, 1, &bh);
0b578f358a6a7a Chandan Rajendra 2019-05-20 1080 wait[nr_wait++] = bh;
2058f83a728adf Michael Halcrow 2015-04-12 1081 }
2058f83a728adf Michael Halcrow 2015-04-12 1082 }
2058f83a728adf Michael Halcrow 2015-04-12 1083 /*
2058f83a728adf Michael Halcrow 2015-04-12 1084 * If we issued read requests, let them complete.
2058f83a728adf Michael Halcrow 2015-04-12 1085 */
0b578f358a6a7a Chandan Rajendra 2019-05-20 1086 for (i = 0; i < nr_wait; i++) {
0b578f358a6a7a Chandan Rajendra 2019-05-20 1087 wait_on_buffer(wait[i]);
0b578f358a6a7a Chandan Rajendra 2019-05-20 1088 if (!buffer_uptodate(wait[i]))
2058f83a728adf Michael Halcrow 2015-04-12 1089 err = -EIO;
2058f83a728adf Michael Halcrow 2015-04-12 1090 }
7e0785fce14f75 Chandan Rajendra 2019-05-20 1091 if (unlikely(err)) {
2058f83a728adf Michael Halcrow 2015-04-12 1092 page_zero_new_buffers(page, from, to);
0b578f358a6a7a Chandan Rajendra 2019-05-20 1093 } else if (IS_ENCRYPTED(inode) && S_ISREG(inode->i_mode)) {
0b578f358a6a7a Chandan Rajendra 2019-05-20 1094 for (i = 0; i < nr_wait; i++) {
0b578f358a6a7a Chandan Rajendra 2019-05-20 1095 int err2;
0b578f358a6a7a Chandan Rajendra 2019-05-20 1096
0b578f358a6a7a Chandan Rajendra 2019-05-20 @1097 err2 = fscrypt_decrypt_pagecache_blocks(page, blocksize,
0b578f358a6a7a Chandan Rajendra 2019-05-20 1098 bh_offset(wait[i]));
0b578f358a6a7a Chandan Rajendra 2019-05-20 1099 if (err2) {
0b578f358a6a7a Chandan Rajendra 2019-05-20 1100 clear_buffer_uptodate(wait[i]);
0b578f358a6a7a Chandan Rajendra 2019-05-20 1101 err = err2;
0b578f358a6a7a Chandan Rajendra 2019-05-20 1102 }
0b578f358a6a7a Chandan Rajendra 2019-05-20 1103 }
7e0785fce14f75 Chandan Rajendra 2019-05-20 1104 }
7e0785fce14f75 Chandan Rajendra 2019-05-20 1105
2058f83a728adf Michael Halcrow 2015-04-12 1106 return err;
2058f83a728adf Michael Halcrow 2015-04-12 1107 }
2058f83a728adf Michael Halcrow 2015-04-12 1108 #endif
2058f83a728adf Michael Halcrow 2015-04-12 1109
:::::: The code at line 1097 was first introduced by commit
:::::: 0b578f358a6a7afee2ddc48dd39c2972726187de ext4: decrypt only the needed blocks in ext4_block_write_begin()
:::::: TO: Chandan Rajendra <chandan@xxxxxxxxxxxxx>
:::::: CC: Eric Biggers <ebiggers@xxxxxxxxxx>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx Intel Corporation
Attachment:
.config.gz
Description: application/gzip