[jth:btrfs-integrity 2/6] fs/btrfs/ctree.h:1373:7: error: 'BTRFS_MOUNT_AUTH_HASH' undeclared; did you mean
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jth/linux.git btrfs-integrity
head: 178abf17d0aba23b45096ce15ff41bf56f01340b
commit: 2706df932e9847b14a2a0592fedad8b8c4a11077 [2/6] btrfs: add authentication support
config: x86_64-kexec (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/jth/linux.git/commit/?id=...
git remote add jth https://git.kernel.org/pub/scm/linux/kernel/git/jth/linux.git
git fetch --no-tags jth btrfs-integrity
git checkout 2706df932e9847b14a2a0592fedad8b8c4a11077
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from fs/btrfs/inode.c:36:
fs/btrfs/inode.c: In function 'btrfs_swap_activate':
>> fs/btrfs/ctree.h:1373:7: error: 'BTRFS_MOUNT_AUTH_HASH' undeclared (first use in this function); did you mean 'BTRFS_MOUNT_AUTH_KEY'?
1373 | BTRFS_MOUNT_##opt)
| ^~~~~~~~~~~~
fs/btrfs/inode.c:10062:6: note: in expansion of macro 'btrfs_test_opt'
10062 | if (btrfs_test_opt(fs_info, AUTH_HASH)) {
| ^~~~~~~~~~~~~~
fs/btrfs/ctree.h:1373:7: note: each undeclared identifier is reported only once for each function it appears in
1373 | BTRFS_MOUNT_##opt)
| ^~~~~~~~~~~~
fs/btrfs/inode.c:10062:6: note: in expansion of macro 'btrfs_test_opt'
10062 | if (btrfs_test_opt(fs_info, AUTH_HASH)) {
| ^~~~~~~~~~~~~~
vim +1373 fs/btrfs/ctree.h
8b87dc17fbc7443 David Sterba 2013-08-01 1368
b6cda9bcb4df754 Chris Mason 2007-12-14 1369 #define btrfs_clear_opt(o, opt) ((o) &= ~BTRFS_MOUNT_##opt)
b6cda9bcb4df754 Chris Mason 2007-12-14 1370 #define btrfs_set_opt(o, opt) ((o) |= BTRFS_MOUNT_##opt)
dc81cdc58ad2f41 Miao Xie 2013-02-20 1371 #define btrfs_raw_test_opt(o, opt) ((o) & BTRFS_MOUNT_##opt)
3cdde2240d4533f Jeff Mahoney 2016-06-09 1372 #define btrfs_test_opt(fs_info, opt) ((fs_info)->mount_opt & \
b6cda9bcb4df754 Chris Mason 2007-12-14 @1373 BTRFS_MOUNT_##opt)
572d9ab7845ea0e David Sterba 2014-02-05 1374
:::::: The code at line 1373 was first introduced by commit
:::::: b6cda9bcb4df7544c67fc3548a53bc1607d59f46 Btrfs: Add mount -o nodatasum to turn of file data checksumming
:::::: TO: Chris Mason <chris.mason(a)oracle.com>
:::::: CC: Chris Mason <chris.mason(a)oracle.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
Re: [PATCH] btrfs: Simplify setup_nodes_for_search
by kernel test robot
Hi Nikolay,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on kdave/for-next]
[also build test WARNING on next-20201112]
[cannot apply to v5.10-rc3]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Nikolay-Borisov/btrfs-Simplify-s...
base: https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next
config: riscv-randconfig-r011-20201112 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project a7b65741441556d295079fc4f2391d99fd1c1111)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/0day-ci/linux/commit/aea2237f4b88d91fc8ad6469b205ff6ad...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Nikolay-Borisov/btrfs-Simplify-setup_nodes_for_search/20201112-191847
git checkout aea2237f4b88d91fc8ad6469b205ff6ada2fcf55
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
^
include/uapi/linux/byteorder/little_endian.h:36:51: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
^
In file included from fs/btrfs/ctree.c:10:
In file included from fs/btrfs/ctree.h:11:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:10:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:13:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:572:9: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return inl(addr);
^~~~~~~~~
arch/riscv/include/asm/io.h:57:76: note: expanded from macro 'inl'
#define inl(c) ({ u32 __v; __io_pbr(); __v = readl_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:89:76: note: expanded from macro 'readl_cpu'
#define readl_cpu(c) ({ u32 __r = le32_to_cpu((__force __le32)__raw_readl(c)); __r; })
^
include/uapi/linux/byteorder/little_endian.h:34:51: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
^
In file included from fs/btrfs/ctree.c:10:
In file included from fs/btrfs/ctree.h:11:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:10:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:13:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:580:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outb(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:59:68: note: expanded from macro 'outb'
#define outb(v,c) ({ __io_pbw(); writeb_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:91:52: note: expanded from macro 'writeb_cpu'
#define writeb_cpu(v, c) ((void)__raw_writeb((v), (c)))
^
In file included from fs/btrfs/ctree.c:10:
In file included from fs/btrfs/ctree.h:11:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:10:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:13:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:588:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outw(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:60:68: note: expanded from macro 'outw'
#define outw(v,c) ({ __io_pbw(); writew_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:92:76: note: expanded from macro 'writew_cpu'
#define writew_cpu(v, c) ((void)__raw_writew((__force u16)cpu_to_le16(v), (c)))
^
In file included from fs/btrfs/ctree.c:10:
In file included from fs/btrfs/ctree.h:11:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:10:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:13:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:596:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outl(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:61:68: note: expanded from macro 'outl'
#define outl(v,c) ({ __io_pbw(); writel_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:93:76: note: expanded from macro 'writel_cpu'
#define writel_cpu(v, c) ((void)__raw_writel((__force u32)cpu_to_le32(v), (c)))
^
In file included from fs/btrfs/ctree.c:10:
In file included from fs/btrfs/ctree.h:11:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:10:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:13:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:1005:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
~~~~~~~~~~ ^
fs/btrfs/ctree.c:2408:13: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
} else if (ins_len < 0 && btrfs_header_nritems(b) <
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/btrfs/ctree.c:2429:9: note: uninitialized use occurs here
return ret;
^~~
fs/btrfs/ctree.c:2408:9: note: remove the 'if' if its condition is always true
} else if (ins_len < 0 && btrfs_header_nritems(b) <
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> fs/btrfs/ctree.c:2408:13: warning: variable 'ret' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]
} else if (ins_len < 0 && btrfs_header_nritems(b) <
^~~~~~~~~~~
fs/btrfs/ctree.c:2429:9: note: uninitialized use occurs here
return ret;
^~~
fs/btrfs/ctree.c:2408:13: note: remove the '&&' if its condition is always true
} else if (ins_len < 0 && btrfs_header_nritems(b) <
^~~~~~~~~~~~~~
fs/btrfs/ctree.c:2393:9: note: initialize the variable 'ret' to silence this warning
int ret;
^
= 0
9 warnings generated.
vim +2408 fs/btrfs/ctree.c
c8c42864f619363 Chris Mason 2009-04-03 2376
c8c42864f619363 Chris Mason 2009-04-03 2377 /*
c8c42864f619363 Chris Mason 2009-04-03 2378 * helper function for btrfs_search_slot. This does all of the checks
c8c42864f619363 Chris Mason 2009-04-03 2379 * for node-level blocks and does any balancing required based on
c8c42864f619363 Chris Mason 2009-04-03 2380 * the ins_len.
c8c42864f619363 Chris Mason 2009-04-03 2381 *
c8c42864f619363 Chris Mason 2009-04-03 2382 * If no extra work was required, zero is returned. If we had to
c8c42864f619363 Chris Mason 2009-04-03 2383 * drop the path, -EAGAIN is returned and btrfs_search_slot must
c8c42864f619363 Chris Mason 2009-04-03 2384 * start over
c8c42864f619363 Chris Mason 2009-04-03 2385 */
c8c42864f619363 Chris Mason 2009-04-03 2386 static int
c8c42864f619363 Chris Mason 2009-04-03 2387 setup_nodes_for_search(struct btrfs_trans_handle *trans,
c8c42864f619363 Chris Mason 2009-04-03 2388 struct btrfs_root *root, struct btrfs_path *p,
bd681513fa6f2ff Chris Mason 2011-07-16 2389 struct extent_buffer *b, int level, int ins_len,
bd681513fa6f2ff Chris Mason 2011-07-16 2390 int *write_lock_level)
c8c42864f619363 Chris Mason 2009-04-03 2391 {
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 2392 struct btrfs_fs_info *fs_info = root->fs_info;
c8c42864f619363 Chris Mason 2009-04-03 2393 int ret;
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 2394
c8c42864f619363 Chris Mason 2009-04-03 2395 if ((p->search_for_split || ins_len > 0) && btrfs_header_nritems(b) >=
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 2396 BTRFS_NODEPTRS_PER_BLOCK(fs_info) - 3) {
c8c42864f619363 Chris Mason 2009-04-03 2397
bd681513fa6f2ff Chris Mason 2011-07-16 2398 if (*write_lock_level < level + 1) {
bd681513fa6f2ff Chris Mason 2011-07-16 2399 *write_lock_level = level + 1;
bd681513fa6f2ff Chris Mason 2011-07-16 2400 btrfs_release_path(p);
aea2237f4b88d91 Nikolay Borisov 2020-11-12 2401 return -EAGAIN;
bd681513fa6f2ff Chris Mason 2011-07-16 2402 }
bd681513fa6f2ff Chris Mason 2011-07-16 2403
480b65236526f4c Josef Bacik 2020-11-05 2404 reada_for_balance(p, level);
aea2237f4b88d91 Nikolay Borisov 2020-11-12 2405 ret = split_node(trans, root, p, level);
c8c42864f619363 Chris Mason 2009-04-03 2406
c8c42864f619363 Chris Mason 2009-04-03 2407 b = p->nodes[level];
c8c42864f619363 Chris Mason 2009-04-03 @2408 } else if (ins_len < 0 && btrfs_header_nritems(b) <
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 2409 BTRFS_NODEPTRS_PER_BLOCK(fs_info) / 2) {
c8c42864f619363 Chris Mason 2009-04-03 2410
bd681513fa6f2ff Chris Mason 2011-07-16 2411 if (*write_lock_level < level + 1) {
bd681513fa6f2ff Chris Mason 2011-07-16 2412 *write_lock_level = level + 1;
bd681513fa6f2ff Chris Mason 2011-07-16 2413 btrfs_release_path(p);
aea2237f4b88d91 Nikolay Borisov 2020-11-12 2414 return -EAGAIN;
bd681513fa6f2ff Chris Mason 2011-07-16 2415 }
bd681513fa6f2ff Chris Mason 2011-07-16 2416
480b65236526f4c Josef Bacik 2020-11-05 2417 reada_for_balance(p, level);
aea2237f4b88d91 Nikolay Borisov 2020-11-12 2418 ret = balance_level(trans, root, p, level);
aea2237f4b88d91 Nikolay Borisov 2020-11-12 2419 if (ret)
aea2237f4b88d91 Nikolay Borisov 2020-11-12 2420 return ret;
c8c42864f619363 Chris Mason 2009-04-03 2421
c8c42864f619363 Chris Mason 2009-04-03 2422 b = p->nodes[level];
c8c42864f619363 Chris Mason 2009-04-03 2423 if (!b) {
b3b4aa74b58bded David Sterba 2011-04-21 2424 btrfs_release_path(p);
aea2237f4b88d91 Nikolay Borisov 2020-11-12 2425 return -EAGAIN;
c8c42864f619363 Chris Mason 2009-04-03 2426 }
c8c42864f619363 Chris Mason 2009-04-03 2427 BUG_ON(btrfs_header_nritems(b) == 1);
c8c42864f619363 Chris Mason 2009-04-03 2428 }
c8c42864f619363 Chris Mason 2009-04-03 2429 return ret;
c8c42864f619363 Chris Mason 2009-04-03 2430 }
c8c42864f619363 Chris Mason 2009-04-03 2431
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
[jth:btrfs-integrity 2/6] fs/btrfs/super.c:1043:1: warning: the frame size of 1120 bytes is larger than 1024 bytes
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jth/linux.git btrfs-integrity
head: 178abf17d0aba23b45096ce15ff41bf56f01340b
commit: 2706df932e9847b14a2a0592fedad8b8c4a11077 [2/6] btrfs: add authentication support
config: h8300-allyesconfig (attached as .config)
compiler: h8300-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/jth/linux.git/commit/?id=...
git remote add jth https://git.kernel.org/pub/scm/linux/kernel/git/jth/linux.git
git fetch --no-tags jth btrfs-integrity
git checkout 2706df932e9847b14a2a0592fedad8b8c4a11077
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=h8300
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from include/asm-generic/bug.h:5,
from arch/h8300/include/asm/bug.h:8,
from include/linux/bug.h:5,
from include/linux/thread_info.h:12,
from include/asm-generic/current.h:5,
from ./arch/h8300/include/generated/asm/current.h:1,
from include/linux/sched.h:12,
from include/linux/blkdev.h:5,
from fs/btrfs/super.c:6:
include/linux/scatterlist.h: In function 'sg_set_buf':
include/asm-generic/page.h:93:50: warning: ordered comparison of pointer with null pointer [-Wextra]
93 | #define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
| ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
fs/btrfs/super.c: In function 'btrfs_parse_options':
>> fs/btrfs/super.c:1043:1: warning: the frame size of 1120 bytes is larger than 1024 bytes [-Wframe-larger-than=]
1043 | }
| ^
vim +1043 fs/btrfs/super.c
74ef00185eb8642 Qu Wenruo 2020-06-04 543
edf24abe51493cc Christoph Hellwig 2008-06-10 544 /*
edf24abe51493cc Christoph Hellwig 2008-06-10 545 * Regular mount options parser. Everything that is needed only when
edf24abe51493cc Christoph Hellwig 2008-06-10 546 * reading in a new superblock is parsed here.
49b25e0540904be Jeff Mahoney 2012-03-01 547 * XXX JDM: This needs to be cleaned up for remount.
edf24abe51493cc Christoph Hellwig 2008-06-10 548 */
2ff7e61e0d30ff1 Jeff Mahoney 2016-06-22 549 int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
96da09192cda57a Qu Wenruo 2016-01-19 550 unsigned long new_flags)
95e0528919cb0c7 Chris Mason 2007-08-29 551 {
95e0528919cb0c7 Chris Mason 2007-08-29 552 substring_t args[MAX_OPT_ARGS];
e215772cd2abcf3 Misono, Tomohiro 2017-12-14 553 char *p, *num;
73bc187680f94be Josef Bacik 2011-10-03 554 u64 cache_gen;
4543df7ecc8ae49 Chris Mason 2008-06-11 555 int intarg;
a7a3f7cadd9bdee Sage Weil 2009-11-07 556 int ret = 0;
261507a02ccba9a Li Zefan 2010-12-17 557 char *compress_type;
261507a02ccba9a Li Zefan 2010-12-17 558 bool compress_force = false;
b7c47bbb2d18563 Tsutomu Itoh 2016-01-06 559 enum btrfs_compression_type saved_compress_type;
27942c9971cc405 David Sterba 2020-07-23 560 int saved_compress_level;
b7c47bbb2d18563 Tsutomu Itoh 2016-01-06 561 bool saved_compress_force;
b7c47bbb2d18563 Tsutomu Itoh 2016-01-06 562 int no_compress = 0;
b6cda9bcb4df754 Chris Mason 2007-12-14 563
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 564 cache_gen = btrfs_super_cache_generation(info->super_copy);
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 565 if (btrfs_fs_compat_ro(info, FREE_SPACE_TREE))
70f6d82ec73c3ae Omar Sandoval 2015-09-29 566 btrfs_set_opt(info->mount_opt, FREE_SPACE_TREE);
70f6d82ec73c3ae Omar Sandoval 2015-09-29 567 else if (cache_gen)
73bc187680f94be Josef Bacik 2011-10-03 568 btrfs_set_opt(info->mount_opt, SPACE_CACHE);
73bc187680f94be Josef Bacik 2011-10-03 569
96da09192cda57a Qu Wenruo 2016-01-19 570 /*
96da09192cda57a Qu Wenruo 2016-01-19 571 * Even the options are empty, we still need to do extra check
96da09192cda57a Qu Wenruo 2016-01-19 572 * against new flags
96da09192cda57a Qu Wenruo 2016-01-19 573 */
95e0528919cb0c7 Chris Mason 2007-08-29 574 if (!options)
96da09192cda57a Qu Wenruo 2016-01-19 575 goto check;
95e0528919cb0c7 Chris Mason 2007-08-29 576
95e0528919cb0c7 Chris Mason 2007-08-29 577 while ((p = strsep(&options, ",")) != NULL) {
95e0528919cb0c7 Chris Mason 2007-08-29 578 int token;
95e0528919cb0c7 Chris Mason 2007-08-29 579 if (!*p)
95e0528919cb0c7 Chris Mason 2007-08-29 580 continue;
95e0528919cb0c7 Chris Mason 2007-08-29 581
95e0528919cb0c7 Chris Mason 2007-08-29 582 token = match_token(p, tokens, args);
95e0528919cb0c7 Chris Mason 2007-08-29 583 switch (token) {
dfe25020689bb2d Chris Mason 2008-05-13 584 case Opt_degraded:
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 585 btrfs_info(info, "allowing degraded mounts");
dfe25020689bb2d Chris Mason 2008-05-13 586 btrfs_set_opt(info->mount_opt, DEGRADED);
dfe25020689bb2d Chris Mason 2008-05-13 587 break;
95e0528919cb0c7 Chris Mason 2007-08-29 588 case Opt_subvol:
37becec95ac31b2 Omar Sandoval 2018-05-21 589 case Opt_subvol_empty:
73f73415caddbc0 Josef Bacik 2009-12-04 590 case Opt_subvolid:
43e570b08a6c6b1 Christoph Hellwig 2008-06-10 591 case Opt_device:
edf24abe51493cc Christoph Hellwig 2008-06-10 592 /*
774f4f329c1e4ba Johannes Thumshirn 2020-05-14 593 * These are parsed by btrfs_parse_subvol_options
774f4f329c1e4ba Johannes Thumshirn 2020-05-14 594 * and btrfs_parse_early_options
774f4f329c1e4ba Johannes Thumshirn 2020-05-14 595 * and can be happily ignored here.
edf24abe51493cc Christoph Hellwig 2008-06-10 596 */
95e0528919cb0c7 Chris Mason 2007-08-29 597 break;
b6cda9bcb4df754 Chris Mason 2007-12-14 598 case Opt_nodatasum:
2706df932e9847b Johannes Thumshirn 2020-05-14 599 if (btrfs_test_opt(info, AUTH_KEY)) {
2706df932e9847b Johannes Thumshirn 2020-05-14 600 btrfs_info(info,
2706df932e9847b Johannes Thumshirn 2020-05-14 601 "nodatasum not supported on an authnticated file-system");
2706df932e9847b Johannes Thumshirn 2020-05-14 602 break;
2706df932e9847b Johannes Thumshirn 2020-05-14 603 }
3cdde2240d4533f Jeff Mahoney 2016-06-09 604 btrfs_set_and_info(info, NODATASUM,
078025347c8ed43 Qu Wenruo 2014-01-13 605 "setting nodatasum");
be20aa9dbadc8c0 Chris Mason 2007-12-17 606 break;
d399167d88ea535 Qu Wenruo 2014-01-06 607 case Opt_datasum:
3cdde2240d4533f Jeff Mahoney 2016-06-09 608 if (btrfs_test_opt(info, NODATASUM)) {
3cdde2240d4533f Jeff Mahoney 2016-06-09 609 if (btrfs_test_opt(info, NODATACOW))
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 610 btrfs_info(info,
5d163e0e68ce743 Jeff Mahoney 2016-09-20 611 "setting datasum, datacow enabled");
d399167d88ea535 Qu Wenruo 2014-01-06 612 else
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 613 btrfs_info(info, "setting datasum");
078025347c8ed43 Qu Wenruo 2014-01-13 614 }
d399167d88ea535 Qu Wenruo 2014-01-06 615 btrfs_clear_opt(info->mount_opt, NODATACOW);
d399167d88ea535 Qu Wenruo 2014-01-06 616 btrfs_clear_opt(info->mount_opt, NODATASUM);
d399167d88ea535 Qu Wenruo 2014-01-06 617 break;
be20aa9dbadc8c0 Chris Mason 2007-12-17 618 case Opt_nodatacow:
2706df932e9847b Johannes Thumshirn 2020-05-14 619 if (btrfs_test_opt(info, AUTH_KEY)) {
2706df932e9847b Johannes Thumshirn 2020-05-14 620 btrfs_info(info,
2706df932e9847b Johannes Thumshirn 2020-05-14 621 "nodatacow not supported on an authnticated file-system");
2706df932e9847b Johannes Thumshirn 2020-05-14 622 break;
2706df932e9847b Johannes Thumshirn 2020-05-14 623 }
3cdde2240d4533f Jeff Mahoney 2016-06-09 624 if (!btrfs_test_opt(info, NODATACOW)) {
3cdde2240d4533f Jeff Mahoney 2016-06-09 625 if (!btrfs_test_opt(info, COMPRESS) ||
3cdde2240d4533f Jeff Mahoney 2016-06-09 626 !btrfs_test_opt(info, FORCE_COMPRESS)) {
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 627 btrfs_info(info,
efe120a067c8674 Frank Holton 2013-12-20 628 "setting nodatacow, compression disabled");
bedb2cca7252d08 Andrei Popa 2012-09-20 629 } else {
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 630 btrfs_info(info, "setting nodatacow");
bedb2cca7252d08 Andrei Popa 2012-09-20 631 }
078025347c8ed43 Qu Wenruo 2014-01-13 632 }
bedb2cca7252d08 Andrei Popa 2012-09-20 633 btrfs_clear_opt(info->mount_opt, COMPRESS);
bedb2cca7252d08 Andrei Popa 2012-09-20 634 btrfs_clear_opt(info->mount_opt, FORCE_COMPRESS);
be20aa9dbadc8c0 Chris Mason 2007-12-17 635 btrfs_set_opt(info->mount_opt, NODATACOW);
b6cda9bcb4df754 Chris Mason 2007-12-14 636 btrfs_set_opt(info->mount_opt, NODATASUM);
b6cda9bcb4df754 Chris Mason 2007-12-14 637 break;
a258af7a3e395a1 Qu Wenruo 2014-01-06 638 case Opt_datacow:
3cdde2240d4533f Jeff Mahoney 2016-06-09 639 btrfs_clear_and_info(info, NODATACOW,
078025347c8ed43 Qu Wenruo 2014-01-13 640 "setting datacow");
a258af7a3e395a1 Qu Wenruo 2014-01-06 641 break;
261507a02ccba9a Li Zefan 2010-12-17 642 case Opt_compress_force:
261507a02ccba9a Li Zefan 2010-12-17 643 case Opt_compress_force_type:
261507a02ccba9a Li Zefan 2010-12-17 644 compress_force = true;
c730ae0c6bb3125 Marcos Paulo de Souza 2020-06-16 645 fallthrough;
c8b978188c9a0fd Chris Mason 2008-10-29 646 case Opt_compress:
261507a02ccba9a Li Zefan 2010-12-17 647 case Opt_compress_type:
3cdde2240d4533f Jeff Mahoney 2016-06-09 648 saved_compress_type = btrfs_test_opt(info,
3cdde2240d4533f Jeff Mahoney 2016-06-09 649 COMPRESS) ?
b7c47bbb2d18563 Tsutomu Itoh 2016-01-06 650 info->compress_type : BTRFS_COMPRESS_NONE;
b7c47bbb2d18563 Tsutomu Itoh 2016-01-06 651 saved_compress_force =
3cdde2240d4533f Jeff Mahoney 2016-06-09 652 btrfs_test_opt(info, FORCE_COMPRESS);
27942c9971cc405 David Sterba 2020-07-23 653 saved_compress_level = info->compress_level;
261507a02ccba9a Li Zefan 2010-12-17 654 if (token == Opt_compress ||
261507a02ccba9a Li Zefan 2010-12-17 655 token == Opt_compress_force ||
a7164fa4e055daf David Sterba 2017-07-17 656 strncmp(args[0].from, "zlib", 4) == 0) {
261507a02ccba9a Li Zefan 2010-12-17 657 compress_type = "zlib";
eae8d82529dd982 Qu Wenruo 2017-11-06 658
261507a02ccba9a Li Zefan 2010-12-17 659 info->compress_type = BTRFS_COMPRESS_ZLIB;
eae8d82529dd982 Qu Wenruo 2017-11-06 660 info->compress_level = BTRFS_ZLIB_DEFAULT_LEVEL;
eae8d82529dd982 Qu Wenruo 2017-11-06 661 /*
eae8d82529dd982 Qu Wenruo 2017-11-06 662 * args[0] contains uninitialized data since
eae8d82529dd982 Qu Wenruo 2017-11-06 663 * for these tokens we don't expect any
eae8d82529dd982 Qu Wenruo 2017-11-06 664 * parameter.
eae8d82529dd982 Qu Wenruo 2017-11-06 665 */
eae8d82529dd982 Qu Wenruo 2017-11-06 666 if (token != Opt_compress &&
eae8d82529dd982 Qu Wenruo 2017-11-06 667 token != Opt_compress_force)
f51d2b59120ff36 David Sterba 2017-09-15 668 info->compress_level =
d0ab62ce2ded362 Dennis Zhou 2019-02-04 669 btrfs_compress_str2level(
d0ab62ce2ded362 Dennis Zhou 2019-02-04 670 BTRFS_COMPRESS_ZLIB,
d0ab62ce2ded362 Dennis Zhou 2019-02-04 671 args[0].from + 4);
063849eafda03ed Arnd Hannemann 2012-04-16 672 btrfs_set_opt(info->mount_opt, COMPRESS);
bedb2cca7252d08 Andrei Popa 2012-09-20 673 btrfs_clear_opt(info->mount_opt, NODATACOW);
bedb2cca7252d08 Andrei Popa 2012-09-20 674 btrfs_clear_opt(info->mount_opt, NODATASUM);
b7c47bbb2d18563 Tsutomu Itoh 2016-01-06 675 no_compress = 0;
a7164fa4e055daf David Sterba 2017-07-17 676 } else if (strncmp(args[0].from, "lzo", 3) == 0) {
a6fa6fae40ec336 Li Zefan 2010-10-25 677 compress_type = "lzo";
a6fa6fae40ec336 Li Zefan 2010-10-25 678 info->compress_type = BTRFS_COMPRESS_LZO;
282dd7d77184446 Marcos Paulo de Souza 2020-08-03 679 info->compress_level = 0;
063849eafda03ed Arnd Hannemann 2012-04-16 680 btrfs_set_opt(info->mount_opt, COMPRESS);
bedb2cca7252d08 Andrei Popa 2012-09-20 681 btrfs_clear_opt(info->mount_opt, NODATACOW);
bedb2cca7252d08 Andrei Popa 2012-09-20 682 btrfs_clear_opt(info->mount_opt, NODATASUM);
2b0ce2c2909368d Mitch Harder 2012-07-24 683 btrfs_set_fs_incompat(info, COMPRESS_LZO);
b7c47bbb2d18563 Tsutomu Itoh 2016-01-06 684 no_compress = 0;
3f93aef535c8ea0 Dennis Zhou 2019-02-04 685 } else if (strncmp(args[0].from, "zstd", 4) == 0) {
5c1aab1dd5445ed Nick Terrell 2017-08-09 686 compress_type = "zstd";
5c1aab1dd5445ed Nick Terrell 2017-08-09 687 info->compress_type = BTRFS_COMPRESS_ZSTD;
3f93aef535c8ea0 Dennis Zhou 2019-02-04 688 info->compress_level =
3f93aef535c8ea0 Dennis Zhou 2019-02-04 689 btrfs_compress_str2level(
3f93aef535c8ea0 Dennis Zhou 2019-02-04 690 BTRFS_COMPRESS_ZSTD,
3f93aef535c8ea0 Dennis Zhou 2019-02-04 691 args[0].from + 4);
5c1aab1dd5445ed Nick Terrell 2017-08-09 692 btrfs_set_opt(info->mount_opt, COMPRESS);
5c1aab1dd5445ed Nick Terrell 2017-08-09 693 btrfs_clear_opt(info->mount_opt, NODATACOW);
5c1aab1dd5445ed Nick Terrell 2017-08-09 694 btrfs_clear_opt(info->mount_opt, NODATASUM);
5c1aab1dd5445ed Nick Terrell 2017-08-09 695 btrfs_set_fs_incompat(info, COMPRESS_ZSTD);
5c1aab1dd5445ed Nick Terrell 2017-08-09 696 no_compress = 0;
063849eafda03ed Arnd Hannemann 2012-04-16 697 } else if (strncmp(args[0].from, "no", 2) == 0) {
063849eafda03ed Arnd Hannemann 2012-04-16 698 compress_type = "no";
27942c9971cc405 David Sterba 2020-07-23 699 info->compress_level = 0;
27942c9971cc405 David Sterba 2020-07-23 700 info->compress_type = 0;
063849eafda03ed Arnd Hannemann 2012-04-16 701 btrfs_clear_opt(info->mount_opt, COMPRESS);
063849eafda03ed Arnd Hannemann 2012-04-16 702 btrfs_clear_opt(info->mount_opt, FORCE_COMPRESS);
063849eafda03ed Arnd Hannemann 2012-04-16 703 compress_force = false;
b7c47bbb2d18563 Tsutomu Itoh 2016-01-06 704 no_compress++;
261507a02ccba9a Li Zefan 2010-12-17 705 } else {
261507a02ccba9a Li Zefan 2010-12-17 706 ret = -EINVAL;
261507a02ccba9a Li Zefan 2010-12-17 707 goto out;
261507a02ccba9a Li Zefan 2010-12-17 708 }
261507a02ccba9a Li Zefan 2010-12-17 709
261507a02ccba9a Li Zefan 2010-12-17 710 if (compress_force) {
b7c47bbb2d18563 Tsutomu Itoh 2016-01-06 711 btrfs_set_opt(info->mount_opt, FORCE_COMPRESS);
143f36361855847 David Sterba 2014-07-29 712 } else {
4027e0f4c4b2df2 Wang Shilong 2014-06-30 713 /*
4027e0f4c4b2df2 Wang Shilong 2014-06-30 714 * If we remount from compress-force=xxx to
4027e0f4c4b2df2 Wang Shilong 2014-06-30 715 * compress=xxx, we need clear FORCE_COMPRESS
4027e0f4c4b2df2 Wang Shilong 2014-06-30 716 * flag, otherwise, there is no way for users
4027e0f4c4b2df2 Wang Shilong 2014-06-30 717 * to disable forcible compression separately.
4027e0f4c4b2df2 Wang Shilong 2014-06-30 718 */
4027e0f4c4b2df2 Wang Shilong 2014-06-30 719 btrfs_clear_opt(info->mount_opt, FORCE_COMPRESS);
a7e252af5a819eb Miao Xie 2013-11-22 720 }
27942c9971cc405 David Sterba 2020-07-23 721 if (no_compress == 1) {
27942c9971cc405 David Sterba 2020-07-23 722 btrfs_info(info, "use no compression");
27942c9971cc405 David Sterba 2020-07-23 723 } else if ((info->compress_type != saved_compress_type) ||
27942c9971cc405 David Sterba 2020-07-23 724 (compress_force != saved_compress_force) ||
27942c9971cc405 David Sterba 2020-07-23 725 (info->compress_level != saved_compress_level)) {
f51d2b59120ff36 David Sterba 2017-09-15 726 btrfs_info(info, "%s %s compression, level %d",
b7c47bbb2d18563 Tsutomu Itoh 2016-01-06 727 (compress_force) ? "force" : "use",
f51d2b59120ff36 David Sterba 2017-09-15 728 compress_type, info->compress_level);
b7c47bbb2d18563 Tsutomu Itoh 2016-01-06 729 }
b7c47bbb2d18563 Tsutomu Itoh 2016-01-06 730 compress_force = false;
a555f810af6d63e Chris Mason 2010-01-28 731 break;
e18e4809b10e6c9 Chris Mason 2008-01-18 732 case Opt_ssd:
3cdde2240d4533f Jeff Mahoney 2016-06-09 733 btrfs_set_and_info(info, SSD,
583b723151794e2 Hans van Kranenburg 2017-07-28 734 "enabling ssd optimizations");
951e7966398b0fd Adam Borowski 2017-03-31 735 btrfs_clear_opt(info->mount_opt, NOSSD);
e18e4809b10e6c9 Chris Mason 2008-01-18 736 break;
451d7585a8bb1b9 Chris Mason 2009-06-09 737 case Opt_ssd_spread:
583b723151794e2 Hans van Kranenburg 2017-07-28 738 btrfs_set_and_info(info, SSD,
583b723151794e2 Hans van Kranenburg 2017-07-28 739 "enabling ssd optimizations");
3cdde2240d4533f Jeff Mahoney 2016-06-09 740 btrfs_set_and_info(info, SSD_SPREAD,
583b723151794e2 Hans van Kranenburg 2017-07-28 741 "using spread ssd allocation scheme");
951e7966398b0fd Adam Borowski 2017-03-31 742 btrfs_clear_opt(info->mount_opt, NOSSD);
451d7585a8bb1b9 Chris Mason 2009-06-09 743 break;
3b30c22f64a6bb2 Chris Mason 2009-06-09 744 case Opt_nossd:
583b723151794e2 Hans van Kranenburg 2017-07-28 745 btrfs_set_opt(info->mount_opt, NOSSD);
583b723151794e2 Hans van Kranenburg 2017-07-28 746 btrfs_clear_and_info(info, SSD,
583b723151794e2 Hans van Kranenburg 2017-07-28 747 "not using ssd optimizations");
c730ae0c6bb3125 Marcos Paulo de Souza 2020-06-16 748 fallthrough;
62b8e077317971b Howard McLauchlan 2018-03-08 749 case Opt_nossd_spread:
583b723151794e2 Hans van Kranenburg 2017-07-28 750 btrfs_clear_and_info(info, SSD_SPREAD,
583b723151794e2 Hans van Kranenburg 2017-07-28 751 "not using spread ssd allocation scheme");
3b30c22f64a6bb2 Chris Mason 2009-06-09 752 break;
842bef5891aaf13 Qu Wenruo 2014-01-06 753 case Opt_barrier:
3cdde2240d4533f Jeff Mahoney 2016-06-09 754 btrfs_clear_and_info(info, NOBARRIER,
078025347c8ed43 Qu Wenruo 2014-01-13 755 "turning on barriers");
842bef5891aaf13 Qu Wenruo 2014-01-06 756 break;
21ad10cf3e9c1ef Chris Mason 2008-01-09 757 case Opt_nobarrier:
3cdde2240d4533f Jeff Mahoney 2016-06-09 758 btrfs_set_and_info(info, NOBARRIER,
078025347c8ed43 Qu Wenruo 2014-01-13 759 "turning off barriers");
21ad10cf3e9c1ef Chris Mason 2008-01-09 760 break;
4543df7ecc8ae49 Chris Mason 2008-06-11 761 case Opt_thread_pool:
2c334e87f31783c Wang Shilong 2013-07-24 762 ret = match_int(&args[0], &intarg);
2c334e87f31783c Wang Shilong 2013-07-24 763 if (ret) {
2c334e87f31783c Wang Shilong 2013-07-24 764 goto out;
f7b885befd05fa4 Anand Jain 2018-02-13 765 } else if (intarg == 0) {
2c334e87f31783c Wang Shilong 2013-07-24 766 ret = -EINVAL;
2c334e87f31783c Wang Shilong 2013-07-24 767 goto out;
2c334e87f31783c Wang Shilong 2013-07-24 768 }
f7b885befd05fa4 Anand Jain 2018-02-13 769 info->thread_pool_size = intarg;
4543df7ecc8ae49 Chris Mason 2008-06-11 770 break;
6f568d35a045dbb Chris Mason 2008-01-29 771 case Opt_max_inline:
edf24abe51493cc Christoph Hellwig 2008-06-10 772 num = match_strdup(&args[0]);
6f568d35a045dbb Chris Mason 2008-01-29 773 if (num) {
91748467a5c5884 Akinobu Mita 2010-02-28 774 info->max_inline = memparse(num, NULL);
6f568d35a045dbb Chris Mason 2008-01-29 775 kfree(num);
6f568d35a045dbb Chris Mason 2008-01-29 776
15ada040d7cd68d Chris Mason 2008-06-11 777 if (info->max_inline) {
feb5f96589302b3 Mitch Harder 2014-02-13 778 info->max_inline = min_t(u64,
15ada040d7cd68d Chris Mason 2008-06-11 779 info->max_inline,
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 780 info->sectorsize);
15ada040d7cd68d Chris Mason 2008-06-11 781 }
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 782 btrfs_info(info, "max_inline at %llu",
c1c9ff7c94e83fa Geert Uytterhoeven 2013-08-20 783 info->max_inline);
2c334e87f31783c Wang Shilong 2013-07-24 784 } else {
2c334e87f31783c Wang Shilong 2013-07-24 785 ret = -ENOMEM;
2c334e87f31783c Wang Shilong 2013-07-24 786 goto out;
6f568d35a045dbb Chris Mason 2008-01-29 787 }
6f568d35a045dbb Chris Mason 2008-01-29 788 break;
bd0330ad2174d1a Qu Wenruo 2014-01-06 789 case Opt_acl:
45ff35d6b9f301c Guangliang Zhao 2014-05-12 790 #ifdef CONFIG_BTRFS_FS_POSIX_ACL
1751e8a6cb935e5 Linus Torvalds 2017-11-27 791 info->sb->s_flags |= SB_POSIXACL;
bd0330ad2174d1a Qu Wenruo 2014-01-06 792 break;
45ff35d6b9f301c Guangliang Zhao 2014-05-12 793 #else
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 794 btrfs_err(info, "support for ACL not compiled in!");
45ff35d6b9f301c Guangliang Zhao 2014-05-12 795 ret = -EINVAL;
45ff35d6b9f301c Guangliang Zhao 2014-05-12 796 goto out;
45ff35d6b9f301c Guangliang Zhao 2014-05-12 797 #endif
33268eaf0b3db5e Josef Bacik 2008-07-24 798 case Opt_noacl:
1751e8a6cb935e5 Linus Torvalds 2017-11-27 799 info->sb->s_flags &= ~SB_POSIXACL;
33268eaf0b3db5e Josef Bacik 2008-07-24 800 break;
3a5e14048a0a812 Sage Weil 2009-04-02 801 case Opt_notreelog:
3cdde2240d4533f Jeff Mahoney 2016-06-09 802 btrfs_set_and_info(info, NOTREELOG,
078025347c8ed43 Qu Wenruo 2014-01-13 803 "disabling tree log");
a88998f291fc707 Qu Wenruo 2014-01-06 804 break;
a88998f291fc707 Qu Wenruo 2014-01-06 805 case Opt_treelog:
3cdde2240d4533f Jeff Mahoney 2016-06-09 806 btrfs_clear_and_info(info, NOTREELOG,
078025347c8ed43 Qu Wenruo 2014-01-13 807 "enabling tree log");
3a5e14048a0a812 Sage Weil 2009-04-02 808 break;
fed8f166ebf3afb Qu Wenruo 2016-01-19 809 case Opt_norecovery:
96da09192cda57a Qu Wenruo 2016-01-19 810 case Opt_nologreplay:
74ef00185eb8642 Qu Wenruo 2020-06-04 811 btrfs_warn(info,
74ef00185eb8642 Qu Wenruo 2020-06-04 812 "'nologreplay' is deprecated, use 'rescue=nologreplay' instead");
3cdde2240d4533f Jeff Mahoney 2016-06-09 813 btrfs_set_and_info(info, NOLOGREPLAY,
96da09192cda57a Qu Wenruo 2016-01-19 814 "disabling log replay at mount time");
96da09192cda57a Qu Wenruo 2016-01-19 815 break;
dccae9999508964 Sage Weil 2009-04-02 816 case Opt_flushoncommit:
3cdde2240d4533f Jeff Mahoney 2016-06-09 817 btrfs_set_and_info(info, FLUSHONCOMMIT,
078025347c8ed43 Qu Wenruo 2014-01-13 818 "turning on flush-on-commit");
dccae9999508964 Sage Weil 2009-04-02 819 break;
2c9ee85671f66cd Qu Wenruo 2014-01-06 820 case Opt_noflushoncommit:
3cdde2240d4533f Jeff Mahoney 2016-06-09 821 btrfs_clear_and_info(info, FLUSHONCOMMIT,
078025347c8ed43 Qu Wenruo 2014-01-13 822 "turning off flush-on-commit");
2c9ee85671f66cd Qu Wenruo 2014-01-06 823 break;
97e728d4353f38c Josef Bacik 2009-04-21 824 case Opt_ratio:
2c334e87f31783c Wang Shilong 2013-07-24 825 ret = match_int(&args[0], &intarg);
764cb8b43d4d804 Anand Jain 2018-02-13 826 if (ret)
2c334e87f31783c Wang Shilong 2013-07-24 827 goto out;
97e728d4353f38c Josef Bacik 2009-04-21 828 info->metadata_ratio = intarg;
764cb8b43d4d804 Anand Jain 2018-02-13 829 btrfs_info(info, "metadata ratio %u",
97e728d4353f38c Josef Bacik 2009-04-21 830 info->metadata_ratio);
97e728d4353f38c Josef Bacik 2009-04-21 831 break;
e244a0aeb6a599c Christoph Hellwig 2009-10-14 832 case Opt_discard:
b0643e59cfa609c Dennis Zhou 2019-12-13 833 case Opt_discard_mode:
b0643e59cfa609c Dennis Zhou 2019-12-13 834 if (token == Opt_discard ||
b0643e59cfa609c Dennis Zhou 2019-12-13 835 strcmp(args[0].from, "sync") == 0) {
b0643e59cfa609c Dennis Zhou 2019-12-13 836 btrfs_clear_opt(info->mount_opt, DISCARD_ASYNC);
46b27f5059e6ce7 Dennis Zhou 2019-12-13 837 btrfs_set_and_info(info, DISCARD_SYNC,
46b27f5059e6ce7 Dennis Zhou 2019-12-13 838 "turning on sync discard");
b0643e59cfa609c Dennis Zhou 2019-12-13 839 } else if (strcmp(args[0].from, "async") == 0) {
b0643e59cfa609c Dennis Zhou 2019-12-13 840 btrfs_clear_opt(info->mount_opt, DISCARD_SYNC);
b0643e59cfa609c Dennis Zhou 2019-12-13 841 btrfs_set_and_info(info, DISCARD_ASYNC,
b0643e59cfa609c Dennis Zhou 2019-12-13 842 "turning on async discard");
b0643e59cfa609c Dennis Zhou 2019-12-13 843 } else {
b0643e59cfa609c Dennis Zhou 2019-12-13 844 ret = -EINVAL;
b0643e59cfa609c Dennis Zhou 2019-12-13 845 goto out;
b0643e59cfa609c Dennis Zhou 2019-12-13 846 }
e244a0aeb6a599c Christoph Hellwig 2009-10-14 847 break;
e07a2ade4426a2c Qu Wenruo 2014-01-06 848 case Opt_nodiscard:
46b27f5059e6ce7 Dennis Zhou 2019-12-13 849 btrfs_clear_and_info(info, DISCARD_SYNC,
078025347c8ed43 Qu Wenruo 2014-01-13 850 "turning off discard");
b0643e59cfa609c Dennis Zhou 2019-12-13 851 btrfs_clear_and_info(info, DISCARD_ASYNC,
b0643e59cfa609c Dennis Zhou 2019-12-13 852 "turning off async discard");
e07a2ade4426a2c Qu Wenruo 2014-01-06 853 break;
0af3d00bad38d3b Josef Bacik 2010-06-21 854 case Opt_space_cache:
70f6d82ec73c3ae Omar Sandoval 2015-09-29 855 case Opt_space_cache_version:
70f6d82ec73c3ae Omar Sandoval 2015-09-29 856 if (token == Opt_space_cache ||
70f6d82ec73c3ae Omar Sandoval 2015-09-29 857 strcmp(args[0].from, "v1") == 0) {
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 858 btrfs_clear_opt(info->mount_opt,
70f6d82ec73c3ae Omar Sandoval 2015-09-29 859 FREE_SPACE_TREE);
3cdde2240d4533f Jeff Mahoney 2016-06-09 860 btrfs_set_and_info(info, SPACE_CACHE,
078025347c8ed43 Qu Wenruo 2014-01-13 861 "enabling disk space caching");
70f6d82ec73c3ae Omar Sandoval 2015-09-29 862 } else if (strcmp(args[0].from, "v2") == 0) {
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 863 btrfs_clear_opt(info->mount_opt,
70f6d82ec73c3ae Omar Sandoval 2015-09-29 864 SPACE_CACHE);
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 865 btrfs_set_and_info(info, FREE_SPACE_TREE,
70f6d82ec73c3ae Omar Sandoval 2015-09-29 866 "enabling free space tree");
70f6d82ec73c3ae Omar Sandoval 2015-09-29 867 } else {
70f6d82ec73c3ae Omar Sandoval 2015-09-29 868 ret = -EINVAL;
70f6d82ec73c3ae Omar Sandoval 2015-09-29 869 goto out;
70f6d82ec73c3ae Omar Sandoval 2015-09-29 870 }
0de90876c6cb774 Josef Bacik 2010-11-19 871 break;
f420ee1e923b931 Stefan Behrens 2013-08-15 872 case Opt_rescan_uuid_tree:
f420ee1e923b931 Stefan Behrens 2013-08-15 873 btrfs_set_opt(info->mount_opt, RESCAN_UUID_TREE);
f420ee1e923b931 Stefan Behrens 2013-08-15 874 break;
73bc187680f94be Josef Bacik 2011-10-03 875 case Opt_no_space_cache:
3cdde2240d4533f Jeff Mahoney 2016-06-09 876 if (btrfs_test_opt(info, SPACE_CACHE)) {
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 877 btrfs_clear_and_info(info, SPACE_CACHE,
078025347c8ed43 Qu Wenruo 2014-01-13 878 "disabling disk space caching");
70f6d82ec73c3ae Omar Sandoval 2015-09-29 879 }
3cdde2240d4533f Jeff Mahoney 2016-06-09 880 if (btrfs_test_opt(info, FREE_SPACE_TREE)) {
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 881 btrfs_clear_and_info(info, FREE_SPACE_TREE,
70f6d82ec73c3ae Omar Sandoval 2015-09-29 882 "disabling free space tree");
70f6d82ec73c3ae Omar Sandoval 2015-09-29 883 }
73bc187680f94be Josef Bacik 2011-10-03 884 break;
4b9465cb9e38591 Chris Mason 2011-06-03 885 case Opt_inode_cache:
b547a88ea5776a8 David Sterba 2020-06-18 886 btrfs_warn(info,
b547a88ea5776a8 David Sterba 2020-06-18 887 "the 'inode_cache' option is deprecated and will have no effect from 5.11");
7e1876aca815029 David Sterba 2014-02-05 888 btrfs_set_pending_and_info(info, INODE_MAP_CACHE,
078025347c8ed43 Qu Wenruo 2014-01-13 889 "enabling inode map caching");
3818aea27542323 Qu Wenruo 2014-01-13 890 break;
3818aea27542323 Qu Wenruo 2014-01-13 891 case Opt_noinode_cache:
7e1876aca815029 David Sterba 2014-02-05 892 btrfs_clear_pending_and_info(info, INODE_MAP_CACHE,
078025347c8ed43 Qu Wenruo 2014-01-13 893 "disabling inode map caching");
4b9465cb9e38591 Chris Mason 2011-06-03 894 break;
88c2ba3b069f1e0 Josef Bacik 2010-09-21 895 case Opt_clear_cache:
3cdde2240d4533f Jeff Mahoney 2016-06-09 896 btrfs_set_and_info(info, CLEAR_CACHE,
078025347c8ed43 Qu Wenruo 2014-01-13 897 "force clearing of disk cache");
0af3d00bad38d3b Josef Bacik 2010-06-21 898 break;
4260f7c7516f4c2 Sage Weil 2010-10-29 899 case Opt_user_subvol_rm_allowed:
4260f7c7516f4c2 Sage Weil 2010-10-29 900 btrfs_set_opt(info->mount_opt, USER_SUBVOL_RM_ALLOWED);
4260f7c7516f4c2 Sage Weil 2010-10-29 901 break;
91435650c233b93 Chris Mason 2011-02-16 902 case Opt_enospc_debug:
91435650c233b93 Chris Mason 2011-02-16 903 btrfs_set_opt(info->mount_opt, ENOSPC_DEBUG);
91435650c233b93 Chris Mason 2011-02-16 904 break;
530362934332e4e Qu Wenruo 2014-01-06 905 case Opt_noenospc_debug:
530362934332e4e Qu Wenruo 2014-01-06 906 btrfs_clear_opt(info->mount_opt, ENOSPC_DEBUG);
530362934332e4e Qu Wenruo 2014-01-06 907 break;
4cb5300bc839b8a Chris Mason 2011-05-24 908 case Opt_defrag:
3cdde2240d4533f Jeff Mahoney 2016-06-09 909 btrfs_set_and_info(info, AUTO_DEFRAG,
078025347c8ed43 Qu Wenruo 2014-01-13 910 "enabling auto defrag");
4cb5300bc839b8a Chris Mason 2011-05-24 911 break;
fc0ca9af180b91a Qu Wenruo 2014-01-06 912 case Opt_nodefrag:
3cdde2240d4533f Jeff Mahoney 2016-06-09 913 btrfs_clear_and_info(info, AUTO_DEFRAG,
078025347c8ed43 Qu Wenruo 2014-01-13 914 "disabling auto defrag");
fc0ca9af180b91a Qu Wenruo 2014-01-06 915 break;
af31f5e5b84b5bf Chris Mason 2011-11-03 916 case Opt_recovery:
8dcddfa048de637 Qu Wenruo 2016-01-19 917 case Opt_usebackuproot:
74ef00185eb8642 Qu Wenruo 2020-06-04 918 btrfs_warn(info,
74ef00185eb8642 Qu Wenruo 2020-06-04 919 "'%s' is deprecated, use 'rescue=usebackuproot' instead",
74ef00185eb8642 Qu Wenruo 2020-06-04 920 token == Opt_recovery ? "recovery" :
74ef00185eb8642 Qu Wenruo 2020-06-04 921 "usebackuproot");
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 922 btrfs_info(info,
8dcddfa048de637 Qu Wenruo 2016-01-19 923 "trying to use backup root at mount time");
8dcddfa048de637 Qu Wenruo 2016-01-19 924 btrfs_set_opt(info->mount_opt, USEBACKUPROOT);
af31f5e5b84b5bf Chris Mason 2011-11-03 925 break;
9555c6c180600b4 Ilya Dryomov 2012-01-16 926 case Opt_skip_balance:
9555c6c180600b4 Ilya Dryomov 2012-01-16 927 btrfs_set_opt(info->mount_opt, SKIP_BALANCE);
9555c6c180600b4 Ilya Dryomov 2012-01-16 928 break;
21adbd5cbb5344a Stefan Behrens 2011-11-09 929 #ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY
21adbd5cbb5344a Stefan Behrens 2011-11-09 930 case Opt_check_integrity_including_extent_data:
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 931 btrfs_info(info,
efe120a067c8674 Frank Holton 2013-12-20 932 "enabling check integrity including extent data");
21adbd5cbb5344a Stefan Behrens 2011-11-09 933 btrfs_set_opt(info->mount_opt,
21adbd5cbb5344a Stefan Behrens 2011-11-09 934 CHECK_INTEGRITY_INCLUDING_EXTENT_DATA);
21adbd5cbb5344a Stefan Behrens 2011-11-09 935 btrfs_set_opt(info->mount_opt, CHECK_INTEGRITY);
21adbd5cbb5344a Stefan Behrens 2011-11-09 936 break;
21adbd5cbb5344a Stefan Behrens 2011-11-09 937 case Opt_check_integrity:
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 938 btrfs_info(info, "enabling check integrity");
21adbd5cbb5344a Stefan Behrens 2011-11-09 939 btrfs_set_opt(info->mount_opt, CHECK_INTEGRITY);
21adbd5cbb5344a Stefan Behrens 2011-11-09 940 break;
21adbd5cbb5344a Stefan Behrens 2011-11-09 941 case Opt_check_integrity_print_mask:
2c334e87f31783c Wang Shilong 2013-07-24 942 ret = match_int(&args[0], &intarg);
02453bdeb02482c Anand Jain 2018-02-13 943 if (ret)
2c334e87f31783c Wang Shilong 2013-07-24 944 goto out;
21adbd5cbb5344a Stefan Behrens 2011-11-09 945 info->check_integrity_print_mask = intarg;
02453bdeb02482c Anand Jain 2018-02-13 946 btrfs_info(info, "check_integrity_print_mask 0x%x",
21adbd5cbb5344a Stefan Behrens 2011-11-09 947 info->check_integrity_print_mask);
21adbd5cbb5344a Stefan Behrens 2011-11-09 948 break;
21adbd5cbb5344a Stefan Behrens 2011-11-09 949 #else
21adbd5cbb5344a Stefan Behrens 2011-11-09 950 case Opt_check_integrity_including_extent_data:
21adbd5cbb5344a Stefan Behrens 2011-11-09 951 case Opt_check_integrity:
21adbd5cbb5344a Stefan Behrens 2011-11-09 952 case Opt_check_integrity_print_mask:
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 953 btrfs_err(info,
efe120a067c8674 Frank Holton 2013-12-20 954 "support for check_integrity* not compiled in!");
21adbd5cbb5344a Stefan Behrens 2011-11-09 955 ret = -EINVAL;
21adbd5cbb5344a Stefan Behrens 2011-11-09 956 goto out;
21adbd5cbb5344a Stefan Behrens 2011-11-09 957 #endif
8c3429300181be4 Jeff Mahoney 2011-10-03 958 case Opt_fatal_errors:
8c3429300181be4 Jeff Mahoney 2011-10-03 959 if (strcmp(args[0].from, "panic") == 0)
8c3429300181be4 Jeff Mahoney 2011-10-03 960 btrfs_set_opt(info->mount_opt,
8c3429300181be4 Jeff Mahoney 2011-10-03 961 PANIC_ON_FATAL_ERROR);
8c3429300181be4 Jeff Mahoney 2011-10-03 962 else if (strcmp(args[0].from, "bug") == 0)
8c3429300181be4 Jeff Mahoney 2011-10-03 963 btrfs_clear_opt(info->mount_opt,
8c3429300181be4 Jeff Mahoney 2011-10-03 964 PANIC_ON_FATAL_ERROR);
8c3429300181be4 Jeff Mahoney 2011-10-03 965 else {
8c3429300181be4 Jeff Mahoney 2011-10-03 966 ret = -EINVAL;
8c3429300181be4 Jeff Mahoney 2011-10-03 967 goto out;
8c3429300181be4 Jeff Mahoney 2011-10-03 968 }
8c3429300181be4 Jeff Mahoney 2011-10-03 969 break;
8b87dc17fbc7443 David Sterba 2013-08-01 970 case Opt_commit_interval:
8b87dc17fbc7443 David Sterba 2013-08-01 971 intarg = 0;
8b87dc17fbc7443 David Sterba 2013-08-01 972 ret = match_int(&args[0], &intarg);
d3740608646f72f Anand Jain 2018-02-13 973 if (ret)
8b87dc17fbc7443 David Sterba 2013-08-01 974 goto out;
d3740608646f72f Anand Jain 2018-02-13 975 if (intarg == 0) {
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 976 btrfs_info(info,
d3740608646f72f Anand Jain 2018-02-13 977 "using default commit interval %us",
8b87dc17fbc7443 David Sterba 2013-08-01 978 BTRFS_DEFAULT_COMMIT_INTERVAL);
d3740608646f72f Anand Jain 2018-02-13 979 intarg = BTRFS_DEFAULT_COMMIT_INTERVAL;
d3740608646f72f Anand Jain 2018-02-13 980 } else if (intarg > 300) {
d3740608646f72f Anand Jain 2018-02-13 981 btrfs_warn(info, "excessive commit interval %d",
d3740608646f72f Anand Jain 2018-02-13 982 intarg);
8b87dc17fbc7443 David Sterba 2013-08-01 983 }
d3740608646f72f Anand Jain 2018-02-13 984 info->commit_interval = intarg;
8b87dc17fbc7443 David Sterba 2013-08-01 985 break;
74ef00185eb8642 Qu Wenruo 2020-06-04 986 case Opt_rescue:
74ef00185eb8642 Qu Wenruo 2020-06-04 987 ret = parse_rescue_options(info, args[0].from);
74ef00185eb8642 Qu Wenruo 2020-06-04 988 if (ret < 0)
74ef00185eb8642 Qu Wenruo 2020-06-04 989 goto out;
74ef00185eb8642 Qu Wenruo 2020-06-04 990 break;
d0bd456074dca08 Josef Bacik 2015-09-23 991 #ifdef CONFIG_BTRFS_DEBUG
d0bd456074dca08 Josef Bacik 2015-09-23 992 case Opt_fragment_all:
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 993 btrfs_info(info, "fragmenting all space");
d0bd456074dca08 Josef Bacik 2015-09-23 994 btrfs_set_opt(info->mount_opt, FRAGMENT_DATA);
d0bd456074dca08 Josef Bacik 2015-09-23 995 btrfs_set_opt(info->mount_opt, FRAGMENT_METADATA);
d0bd456074dca08 Josef Bacik 2015-09-23 996 break;
d0bd456074dca08 Josef Bacik 2015-09-23 997 case Opt_fragment_metadata:
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 998 btrfs_info(info, "fragmenting metadata");
d0bd456074dca08 Josef Bacik 2015-09-23 999 btrfs_set_opt(info->mount_opt,
d0bd456074dca08 Josef Bacik 2015-09-23 1000 FRAGMENT_METADATA);
d0bd456074dca08 Josef Bacik 2015-09-23 1001 break;
d0bd456074dca08 Josef Bacik 2015-09-23 1002 case Opt_fragment_data:
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 1003 btrfs_info(info, "fragmenting data");
d0bd456074dca08 Josef Bacik 2015-09-23 1004 btrfs_set_opt(info->mount_opt, FRAGMENT_DATA);
d0bd456074dca08 Josef Bacik 2015-09-23 1005 break;
fb592373cddeb4e Josef Bacik 2017-09-29 1006 #endif
fb592373cddeb4e Josef Bacik 2017-09-29 1007 #ifdef CONFIG_BTRFS_FS_REF_VERIFY
fb592373cddeb4e Josef Bacik 2017-09-29 1008 case Opt_ref_verify:
fb592373cddeb4e Josef Bacik 2017-09-29 1009 btrfs_info(info, "doing ref verification");
fb592373cddeb4e Josef Bacik 2017-09-29 1010 btrfs_set_opt(info->mount_opt, REF_VERIFY);
fb592373cddeb4e Josef Bacik 2017-09-29 1011 break;
d0bd456074dca08 Josef Bacik 2015-09-23 1012 #endif
a7a3f7cadd9bdee Sage Weil 2009-11-07 1013 case Opt_err:
7e8f19e50e3ccf0 David Sterba 2019-11-27 1014 btrfs_err(info, "unrecognized mount option '%s'", p);
a7a3f7cadd9bdee Sage Weil 2009-11-07 1015 ret = -EINVAL;
a7a3f7cadd9bdee Sage Weil 2009-11-07 1016 goto out;
95e0528919cb0c7 Chris Mason 2007-08-29 1017 default:
be20aa9dbadc8c0 Chris Mason 2007-12-17 1018 break;
95e0528919cb0c7 Chris Mason 2007-08-29 1019 }
95e0528919cb0c7 Chris Mason 2007-08-29 1020 }
96da09192cda57a Qu Wenruo 2016-01-19 1021 check:
5fbc6eb594ec691 Josef Bacik 2020-10-16 1022 /* We're read-only, don't have to check. */
5fbc6eb594ec691 Josef Bacik 2020-10-16 1023 if (new_flags & SB_RDONLY)
5fbc6eb594ec691 Josef Bacik 2020-10-16 1024 goto out;
5fbc6eb594ec691 Josef Bacik 2020-10-16 1025
7450eeae7bb4345 Josef Bacik 2020-10-16 1026 if (check_ro_option(info, BTRFS_MOUNT_NOLOGREPLAY, "nologreplay") ||
b60fde497be1f9a Josef Bacik 2020-10-16 1027 check_ro_option(info, BTRFS_MOUNT_IGNOREBADROOTS, "ignorebadroots") ||
b60fde497be1f9a Josef Bacik 2020-10-16 1028 check_ro_option(info, BTRFS_MOUNT_IGNOREDATACSUMS, "ignoredatacsums"))
96da09192cda57a Qu Wenruo 2016-01-19 1029 ret = -EINVAL;
a7a3f7cadd9bdee Sage Weil 2009-11-07 1030 out:
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 1031 if (btrfs_fs_compat_ro(info, FREE_SPACE_TREE) &&
3cdde2240d4533f Jeff Mahoney 2016-06-09 1032 !btrfs_test_opt(info, FREE_SPACE_TREE) &&
3cdde2240d4533f Jeff Mahoney 2016-06-09 1033 !btrfs_test_opt(info, CLEAR_CACHE)) {
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 1034 btrfs_err(info, "cannot disable free space tree");
70f6d82ec73c3ae Omar Sandoval 2015-09-29 1035 ret = -EINVAL;
70f6d82ec73c3ae Omar Sandoval 2015-09-29 1036
70f6d82ec73c3ae Omar Sandoval 2015-09-29 1037 }
3cdde2240d4533f Jeff Mahoney 2016-06-09 1038 if (!ret && btrfs_test_opt(info, SPACE_CACHE))
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 1039 btrfs_info(info, "disk space caching is enabled");
3cdde2240d4533f Jeff Mahoney 2016-06-09 1040 if (!ret && btrfs_test_opt(info, FREE_SPACE_TREE))
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 1041 btrfs_info(info, "using free space tree");
a7a3f7cadd9bdee Sage Weil 2009-11-07 1042 return ret;
edf24abe51493cc Christoph Hellwig 2008-06-10 @1043 }
edf24abe51493cc Christoph Hellwig 2008-06-10 1044
:::::: The code at line 1043 was first introduced by commit
:::::: edf24abe51493ccda384644d487fe2f796ac21c8 btrfs: sanity mount option parsing and early mount code
:::::: TO: Christoph Hellwig <hch(a)lst.de>
:::::: CC: Chris Mason <chris.mason(a)oracle.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
[osandov:btrfs-send-encoded 11/16] fs/btrfs/file.c:1997:9: warning: no previous prototype for 'btrfs_encoded_write'
by kernel test robot
tree: https://github.com/osandov/linux.git btrfs-send-encoded
head: 69d4fc5054f4b51177caf5771100de46bd10bba8
commit: 68812638bf2d878a7c63f705fa098efe9c900806 [11/16] btrfs: implement RWF_ENCODED writes
config: nds32-randconfig-r032-20201113 (attached as .config)
compiler: nds32le-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/osandov/linux/commit/68812638bf2d878a7c63f705fa098efe9...
git remote add osandov https://github.com/osandov/linux.git
git fetch --no-tags osandov btrfs-send-encoded
git checkout 68812638bf2d878a7c63f705fa098efe9c900806
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nds32
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> fs/btrfs/file.c:1997:9: warning: no previous prototype for 'btrfs_encoded_write' [-Wmissing-prototypes]
1997 | ssize_t btrfs_encoded_write(struct kiocb *iocb, struct iov_iter *from)
| ^~~~~~~~~~~~~~~~~~~
vim +/btrfs_encoded_write +1997 fs/btrfs/file.c
1996
> 1997 ssize_t btrfs_encoded_write(struct kiocb *iocb, struct iov_iter *from)
1998 {
1999 struct file *file = iocb->ki_filp;
2000 struct inode *inode = file_inode(file);
2001 struct encoded_iov encoded;
2002 ssize_t ret;
2003
2004 ret = copy_encoded_iov_from_iter(&encoded, from);
2005 if (ret)
2006 return ret;
2007
2008 btrfs_inode_lock(inode, 0);
2009 ret = generic_encoded_write_checks(iocb, &encoded);
2010 if (ret || encoded.len == 0)
2011 goto out;
2012
2013 ret = btrfs_write_check(iocb, from, encoded.len);
2014 if (ret < 0)
2015 goto out;
2016
2017 ret = btrfs_do_encoded_write(iocb, from, &encoded);
2018 out:
2019 btrfs_inode_unlock(inode, 0);
2020 return ret;
2021 }
2022
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
drivers/usb/typec/tcpm/wcove.c:380:50: sparse: sparse: incorrect type in argument 1 (different base types)
by kernel test robot
Hi Mika,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 585e5b17b92dead8a3aca4e3c9876fbca5f7e0ba
commit: 25f1ca31e230598eaf3c38d387a355a64bd772a7 platform/x86: intel_pmc_ipc: Convert to MFD
date: 7 months ago
config: x86_64-randconfig-s022-20201113 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-107-gaf3512a6-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 25f1ca31e230598eaf3c38d387a355a64bd772a7
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"sparse warnings: (new ones prefixed by >>)"
>> drivers/usb/typec/tcpm/wcove.c:380:50: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned short [usertype] header @@ got restricted __le16 const [usertype] header @@
>> drivers/usb/typec/tcpm/wcove.c:380:50: sparse: expected unsigned short [usertype] header
>> drivers/usb/typec/tcpm/wcove.c:380:50: sparse: got restricted __le16 const [usertype] header
vim +380 drivers/usb/typec/tcpm/wcove.c
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 356
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 357 static int wcove_pd_transmit(struct tcpc_dev *tcpc,
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 358 enum tcpm_transmit_type type,
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 359 const struct pd_message *msg)
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 360 {
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 361 struct wcove_typec *wcove = tcpc_to_wcove(tcpc);
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 362 unsigned int info = 0;
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 363 unsigned int cmd;
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 364 int ret;
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 365
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 366 ret = regmap_read(wcove->regmap, USBC_TXCMD, &cmd);
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 367 if (ret)
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 368 return ret;
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 369
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 370 if (!(cmd & USBC_TXCMD_BUF_RDY)) {
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 371 dev_warn(wcove->dev, "%s: Last transmission still ongoing!",
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 372 __func__);
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 373 return -EBUSY;
d2061f9cc32dbb8 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-03-21 374 }
d2061f9cc32dbb8 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-03-21 375
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 376 if (msg) {
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 377 const u8 *data = (void *)msg;
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 378 int i;
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 379
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 @380 for (i = 0; i < pd_header_cnt(msg->header) * 4 + 2; i++) {
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 381 ret = regmap_write(wcove->regmap, USBC_TX_DATA + i,
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 382 data[i]);
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 383 if (ret)
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 384 return ret;
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 385 }
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 386 }
d2061f9cc32dbb8 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-03-21 387
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 388 switch (type) {
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 389 case TCPC_TX_SOP:
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 390 case TCPC_TX_SOP_PRIME:
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 391 case TCPC_TX_SOP_PRIME_PRIME:
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 392 case TCPC_TX_SOP_DEBUG_PRIME:
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 393 case TCPC_TX_SOP_DEBUG_PRIME_PRIME:
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 394 info = type + 1;
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 395 cmd = USBC_TXCMD_MSG;
d2061f9cc32dbb8 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-03-21 396 break;
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 397 case TCPC_TX_HARD_RESET:
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 398 cmd = USBC_TXCMD_HR;
d2061f9cc32dbb8 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-03-21 399 break;
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 400 case TCPC_TX_CABLE_RESET:
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 401 cmd = USBC_TXCMD_CR;
d2061f9cc32dbb8 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-03-21 402 break;
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 403 case TCPC_TX_BIST_MODE_2:
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 404 cmd = USBC_TXCMD_BIST;
d2061f9cc32dbb8 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-03-21 405 break;
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 406 default:
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 407 return -EINVAL;
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 408 }
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 409
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 410 /* NOTE Setting maximum number of retries (7) */
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 411 ret = regmap_write(wcove->regmap, USBC_TXINFO,
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 412 info | USBC_TXINFO_RETRIES(7));
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 413 if (ret)
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 414 return ret;
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 415
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 416 return regmap_write(wcove->regmap, USBC_TXCMD, cmd | USBC_TXCMD_START);
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 417 }
3c4fb9f16921429 drivers/usb/typec/typec_wcove.c Heikki Krogerus 2017-09-20 418
:::::: The code at line 380 was first introduced by commit
:::::: 3c4fb9f169214290ec9a943907321e6265b36f65 usb: typec: wcove: start using tcpm for USB PD support
:::::: TO: Heikki Krogerus <heikki.krogerus(a)linux.intel.com>
:::::: CC: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
[linux-rt-devel:linux-5.10.y-rt-rebase 80/248] kernel/printk/printk.c:2581:6: error: implicit declaration of function 'kernel_sync_mode'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-5.10.y-rt-rebase
head: 13ce1b83bb2b44f074b4fda849bb8b200adca084
commit: c95870903b0a88c5661755d5ab1f5cba6efa3de9 [80/248] printk: introduce kernel sync mode
config: sparc-allnoconfig (attached as .config)
compiler: sparc-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git/com...
git remote add linux-rt-devel https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git
git fetch --no-tags linux-rt-devel linux-5.10.y-rt-rebase
git checkout c95870903b0a88c5661755d5ab1f5cba6efa3de9
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sparc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from kernel/printk/printk.c:62:
kernel/printk/internal.h:56:20: warning: no previous prototype for 'vprintk_func' [-Wmissing-prototypes]
56 | __printf(1, 0) int vprintk_func(const char *fmt, va_list args) { return 0; }
| ^~~~~~~~~~~~
kernel/printk/printk.c:179:5: warning: no previous prototype for 'devkmsg_sysctl_set_loglvl' [-Wmissing-prototypes]
179 | int devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
kernel/printk/printk.c:2297:33: error: implicit declaration of function 'ATOMI64_INIT'; did you mean 'ATOMIC64_INIT'? [-Werror=implicit-function-declaration]
2297 | static atomic64_t console_seq = ATOMI64_INIT(0);
| ^~~~~~~~~~~~
| ATOMIC64_INIT
kernel/printk/printk.c:2297:33: error: invalid initializer
kernel/printk/printk.c: In function 'can_use_console':
>> kernel/printk/printk.c:2581:6: error: implicit declaration of function 'kernel_sync_mode' [-Werror=implicit-function-declaration]
2581 | if (kernel_sync_mode())
| ^~~~~~~~~~~~~~~~
kernel/printk/printk.c: At top level:
kernel/printk/printk.c:3693:6: warning: no previous prototype for 'prb_lock' [-Wmissing-prototypes]
3693 | void prb_lock(struct prb_cpulock *cpu_lock, unsigned int *cpu_store)
| ^~~~~~~~
kernel/printk/printk.c:3711:6: warning: no previous prototype for 'prb_unlock' [-Wmissing-prototypes]
3711 | void prb_unlock(struct prb_cpulock *cpu_lock, unsigned int cpu_store)
| ^~~~~~~~~~
kernel/printk/printk.c:83:13: warning: 'sync_mode' defined but not used [-Wunused-variable]
83 | static bool sync_mode;
| ^~~~~~~~~
cc1: some warnings being treated as errors
vim +/kernel_sync_mode +2581 kernel/printk/printk.c
2571
2572 /*
2573 * Can we actually use the console at this time on this cpu?
2574 *
2575 * Console drivers may assume that per-cpu resources have been allocated. So
2576 * unless they're explicitly marked as being able to cope (CON_ANYTIME) don't
2577 * call them until this CPU is officially up.
2578 */
2579 static inline int can_use_console(void)
2580 {
> 2581 if (kernel_sync_mode())
2582 return false;
2583 return cpu_online(raw_smp_processor_id()) || have_callable_console();
2584 }
2585
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
[skn:v5.10/ffa 5/9] drivers/firmware/arm_ffa/bus.c:173:12: warning: no previous prototype for function 'arm_ffa_bus_init'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git v5.10/ffa
head: 9ce10ec03a756e0d3eccc023202850b73f32763b
commit: 3f6a528cbb0b1a6342035baf9f44b32947989346 [5/9] firmware: arm_ffa: Add initial Arm FFA driver support
config: arm64-randconfig-r032-20201113 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 9e0c35655b6e8186baef8840b26ba4090503b554)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/co...
git remote add skn https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git
git fetch --no-tags skn v5.10/ffa
git checkout 3f6a528cbb0b1a6342035baf9f44b32947989346
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/firmware/arm_ffa/bus.c:173:12: warning: no previous prototype for function 'arm_ffa_bus_init' [-Wmissing-prototypes]
int __init arm_ffa_bus_init(void)
^
drivers/firmware/arm_ffa/bus.c:173:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int __init arm_ffa_bus_init(void)
^
static
>> drivers/firmware/arm_ffa/bus.c:192:13: warning: no previous prototype for function 'arm_ffa_bus_exit' [-Wmissing-prototypes]
void __exit arm_ffa_bus_exit(void)
^
drivers/firmware/arm_ffa/bus.c:192:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void __exit arm_ffa_bus_exit(void)
^
static
2 warnings generated.
vim +/arm_ffa_bus_init +173 drivers/firmware/arm_ffa/bus.c
172
> 173 int __init arm_ffa_bus_init(void)
174 {
175 int ret;
176
177 ret = alloc_chrdev_region(&ffa_devt, 0, FFA_MAX_CDEVS, DEVICE_NAME);
178 if (ret) {
179 pr_err("failed to allocate char dev region\n");
180 return ret;
181 }
182
183 ret = bus_register(&ffa_bus_type);
184 if (ret) {
185 pr_err("ffa bus register failed (%d)\n", ret);
186 unregister_chrdev_region(ffa_devt, FFA_MAX_CDEVS);
187 }
188
189 return ret;
190 }
191
> 192 void __exit arm_ffa_bus_exit(void)
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
Re: [net-next 1/8] tcp: Copy straggler unaligned data for TCP Rx. zerocopy.
by kernel test robot
Hi Arjun,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
url: https://github.com/0day-ci/linux/commits/Arjun-Roy/Perf-optimizations-for...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git e545f86573937142b8a90bd65d476b9f001088cf
config: nds32-defconfig (attached as .config)
compiler: nds32le-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/5c20c7c34817692f87427a655374172f6...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Arjun-Roy/Perf-optimizations-for-TCP-Recv-Zerocopy/20201113-030506
git checkout 5c20c7c34817692f87427a655374172f6666d8ed
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nds32
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
net/ipv4/tcp.c: In function 'tcp_copy_straggler_data':
>> net/ipv4/tcp.c:1754:34: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
1754 | err = import_single_range(READ, (void __user *)zc->copybuf_address,
| ^
vim +1754 net/ipv4/tcp.c
1745
1746 static int tcp_copy_straggler_data(struct tcp_zerocopy_receive *zc,
1747 struct sk_buff *skb, u32 copylen,
1748 u32 *offset, u32 *seq)
1749 {
1750 struct msghdr msg = {};
1751 struct iovec iov;
1752 int err;
1753
> 1754 err = import_single_range(READ, (void __user *)zc->copybuf_address,
1755 copylen, &iov, &msg.msg_iter);
1756 if (err)
1757 return err;
1758 err = skb_copy_datagram_msg(skb, *offset, &msg, copylen);
1759 if (err)
1760 return err;
1761 zc->recv_skip_hint -= copylen;
1762 *offset += copylen;
1763 *seq += copylen;
1764 return (__s32)copylen;
1765 }
1766
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
[dhowells-fs:crypto-krb5 25/35] crypto/krb5/selftest.c:304:25: warning: variable 'pad_len' set but not used
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git crypto-krb5
head: 355656a6fe584cb0b68ebc1ca2e56be073b706d0
commit: 077cafc75481bb885a6b044a03c73441e2aeef6f [25/35] crypto/krb5: Implement crypto self-testing
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/com...
git remote add dhowells-fs https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
git fetch --no-tags dhowells-fs crypto-krb5
git checkout 077cafc75481bb885a6b044a03c73441e2aeef6f
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sh
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
crypto/krb5/selftest.c: In function 'krb5_load_enc_buf':
>> crypto/krb5/selftest.c:304:25: warning: variable 'pad_len' set but not used [-Wunused-but-set-variable]
304 | unsigned int conf_len, pad_len, enc_len, ct_len;
| ^~~~~~~
vim +/pad_len +304 crypto/krb5/selftest.c
295
296 /*
297 * Generate a buffer containing encryption test data.
298 */
299 static int krb5_load_enc_buf(const struct krb5_enc_test *test,
300 const struct krb5_buffer *plain,
301 void *buf)
302 {
303 const struct krb5_enctype *krb5 = test->krb5;
> 304 unsigned int conf_len, pad_len, enc_len, ct_len;
305 int ret;
306
307 conf_len = strlen(test->conf);
308 if (VALID((conf_len & 1) || conf_len / 2 != krb5->conf_len))
309 return -EINVAL;
310
311 if (krb5->pad) {
312 enc_len = round_up(krb5->conf_len + plain->len, krb5->block_len);
313 pad_len = enc_len - (krb5->conf_len + plain->len);
314 } else {
315 enc_len = krb5->conf_len + plain->len;
316 pad_len = 0;
317 }
318
319 ct_len = strlen(test->ct);
320 if (VALID((ct_len & 1) || ct_len / 2 != enc_len + krb5->cksum_len))
321 return -EINVAL;
322 ct_len = enc_len + krb5->cksum_len;
323
324 if ((ret = hex2bin(buf, test->conf, krb5->conf_len)) < 0)
325 return ret;
326 buf += krb5->conf_len;
327 memcpy(buf, plain->data, plain->len);
328 return 0;
329 }
330
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months