【Amazon】アカウントの利用状況をご確認ください。
by Amazon.jp
お客様のお支払い方法が承認されません。
お支払方法に問題があり、プライム特典をご利用いただけない状況です。
支払方法を更新する
kbuild-all(a)lists.01.org
平素は、Amazonをご利用いただき、誠にありがとうございます。
ご指定いただいたお客様のお支払い方法が承認されないため。Amazonは無料ですが、ご登録の際には適用可能なお支払い方法を確認させていただきます。これは、ご登録時にご同意いただいたように。
1日以内に、アマゾンからの請求へのお支払いが確認できない限り、お客様のAmazon登録はキャンセルされ。
他の有効な支払方法を更新・追加し、Amazonをご利用されたい場合は、以下の手順に従って更新してください。
お客様のお支払い方法にアクセス
Amazon登録したAmazon.co.jpのアカウントを使用してサインイン
登録済みのお支払手段の有効期限を更新、または新しく支払い手段を追加し、「続行」ボタンをクリック
現在ご指定のお支払い方法が承認されない原因は、提携会社(クレジットカード会社等)の事情により異なりますが、利用可能限度額の超過、有効期限切れ、カード利用不可などが考えられます。大変お手数ですが詳細についてはサービスの提供元会社に直接お問い合わせください。
Amazon.co.jpをご利用いただき、ありがとうございます。
今後ともAmazon.co.jpをよろしくお願いいたします。
Amazon.co.jpカスタマーサービス。
タイムセール プライム特典 アカウント ヘルプ
© 2020 Amazon.com, Inc. or its affiliates. All rights reserved. Amazon, Amazon.co.jp, Amazon Prime, Prime およびAmazon.co.jp のロゴは Amazon.com, Inc.またはその関連会社の商標です。Amazon.com, 410 Terry Avenue N., Seattle, WA 98109-5210
このメッセージはkbuild-all(a)lists.01.xn--org-s83bk2cveuh3e4006ako2h.
7 months
Re: [PATCH] mac80211: fix RCU usage in ieee80211_tx_h_select_key()
by kernel test robot
Hi Jiri,
I love your patch! Perhaps something to improve:
[auto build test WARNING on wireless-next/main]
[also build test WARNING on wireless/main jberg-mac80211-next/master jberg-mac80211/master v5.17-rc4 next-20220215]
[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/Jiri-Kosina/mac80211-fix-RCU-usa...
base: https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git main
config: i386-randconfig-s002-20220214 (https://download.01.org/0day-ci/archive/20220216/202202160406.p1c7XduC-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://github.com/0day-ci/linux/commit/cdfe17d7fc283e125686bdd9a6bbc6fd6...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jiri-Kosina/mac80211-fix-RCU-usage-in-ieee80211_tx_h_select_key/20220215-234935
git checkout cdfe17d7fc283e125686bdd9a6bbc6fd60909bd7
# save the config file to linux build tree
mkdir build_dir
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash net/mac80211/
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 >>)
>> net/mac80211/tx.c:652:29: sparse: sparse: incorrect type in assignment (different base types) @@ expected int ret @@ got restricted ieee80211_tx_result [usertype] @@
net/mac80211/tx.c:652:29: sparse: expected int ret
net/mac80211/tx.c:652:29: sparse: got restricted ieee80211_tx_result [usertype]
net/mac80211/tx.c:661:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected int ret @@ got restricted ieee80211_tx_result [usertype] @@
net/mac80211/tx.c:661:21: sparse: expected int ret
net/mac80211/tx.c:661:21: sparse: got restricted ieee80211_tx_result [usertype]
net/mac80211/tx.c:664:13: sparse: sparse: incorrect type in assignment (different base types) @@ expected int ret @@ got restricted ieee80211_tx_result [usertype] @@
net/mac80211/tx.c:664:13: sparse: expected int ret
net/mac80211/tx.c:664:13: sparse: got restricted ieee80211_tx_result [usertype]
>> net/mac80211/tx.c:667:16: sparse: sparse: incorrect type in return expression (different base types) @@ expected restricted ieee80211_tx_result @@ got int ret @@
net/mac80211/tx.c:667:16: sparse: expected restricted ieee80211_tx_result
net/mac80211/tx.c:667:16: sparse: got int ret
vim +652 net/mac80211/tx.c
579
580 static ieee80211_tx_result debug_noinline
581 ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx)
582 {
583 int ret;
584 struct ieee80211_key *key;
585 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb);
586 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data;
587
588 if (unlikely(info->flags & IEEE80211_TX_INTFL_DONT_ENCRYPT)) {
589 tx->key = NULL;
590 return TX_CONTINUE;
591 }
592
593 rcu_read_lock();
594
595 if (tx->sta &&
596 (key = rcu_dereference(tx->sta->ptk[tx->sta->ptk_idx])))
597 tx->key = key;
598 else if (ieee80211_is_group_privacy_action(tx->skb) &&
599 (key = rcu_dereference(tx->sdata->default_multicast_key)))
600 tx->key = key;
601 else if (ieee80211_is_mgmt(hdr->frame_control) &&
602 is_multicast_ether_addr(hdr->addr1) &&
603 ieee80211_is_robust_mgmt_frame(tx->skb) &&
604 (key = rcu_dereference(tx->sdata->default_mgmt_key)))
605 tx->key = key;
606 else if (is_multicast_ether_addr(hdr->addr1) &&
607 (key = rcu_dereference(tx->sdata->default_multicast_key)))
608 tx->key = key;
609 else if (!is_multicast_ether_addr(hdr->addr1) &&
610 (key = rcu_dereference(tx->sdata->default_unicast_key)))
611 tx->key = key;
612 else
613 tx->key = NULL;
614
615 if (tx->key) {
616 bool skip_hw = false;
617
618 /* TODO: add threshold stuff again */
619
620 switch (tx->key->conf.cipher) {
621 case WLAN_CIPHER_SUITE_WEP40:
622 case WLAN_CIPHER_SUITE_WEP104:
623 case WLAN_CIPHER_SUITE_TKIP:
624 if (!ieee80211_is_data_present(hdr->frame_control))
625 tx->key = NULL;
626 break;
627 case WLAN_CIPHER_SUITE_CCMP:
628 case WLAN_CIPHER_SUITE_CCMP_256:
629 case WLAN_CIPHER_SUITE_GCMP:
630 case WLAN_CIPHER_SUITE_GCMP_256:
631 if (!ieee80211_is_data_present(hdr->frame_control) &&
632 !ieee80211_use_mfp(hdr->frame_control, tx->sta,
633 tx->skb) &&
634 !ieee80211_is_group_privacy_action(tx->skb))
635 tx->key = NULL;
636 else
637 skip_hw = (tx->key->conf.flags &
638 IEEE80211_KEY_FLAG_SW_MGMT_TX) &&
639 ieee80211_is_mgmt(hdr->frame_control);
640 break;
641 case WLAN_CIPHER_SUITE_AES_CMAC:
642 case WLAN_CIPHER_SUITE_BIP_CMAC_256:
643 case WLAN_CIPHER_SUITE_BIP_GMAC_128:
644 case WLAN_CIPHER_SUITE_BIP_GMAC_256:
645 if (!ieee80211_is_mgmt(hdr->frame_control))
646 tx->key = NULL;
647 break;
648 }
649
650 if (unlikely(tx->key && tx->key->flags & KEY_FLAG_TAINTED &&
651 !ieee80211_is_deauth(hdr->frame_control))) {
> 652 ret = TX_DROP;
653 goto out;
654 }
655
656 if (!skip_hw && tx->key &&
657 tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)
658 info->control.hw_key = &tx->key->conf;
659 } else if (ieee80211_is_data_present(hdr->frame_control) && tx->sta &&
660 test_sta_flag(tx->sta, WLAN_STA_USES_ENCRYPTION)) {
661 ret = TX_DROP;
662 goto out;
663 }
664 ret = TX_CONTINUE;
665 out:
666 rcu_read_unlock();
> 667 return ret;
668 }
669
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months
[xilinx-xlnx:xlnx_rebase_v5.15_LTS 231/924] drivers/net/ethernet/xilinx/xilinx_tsn_ptp_clock.c:46:16: error: implicit declaration of function 'in_be32'
by kernel test robot
tree: https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.15_LTS
head: 392586c95ba817468e81d14a767a94f3b43a2898
commit: a7ae7ddafe91c16d0f4bcd4d148c76318f3cfb06 [231/924] net: xilinx: Add support for PL TSN IP features
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20220216/202202160440.Tw9mI9w3-lk...)
compiler: arceb-elf-gcc (GCC) 11.2.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/Xilinx/linux-xlnx/commit/a7ae7ddafe91c16d0f4bcd4d148c7...
git remote add xilinx-xlnx https://github.com/Xilinx/linux-xlnx
git fetch --no-tags xilinx-xlnx xlnx_rebase_v5.15_LTS
git checkout a7ae7ddafe91c16d0f4bcd4d148c76318f3cfb06
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash
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 >>):
drivers/net/ethernet/xilinx/xilinx_tsn_ptp_clock.c: In function 'xlnx_tod_read':
>> drivers/net/ethernet/xilinx/xilinx_tsn_ptp_clock.c:46:16: error: implicit declaration of function 'in_be32' [-Werror=implicit-function-declaration]
46 | nsec = in_be32(timer->baseaddr + XTIMER1588_CURRENT_RTC_NS);
| ^~~~~~~
drivers/net/ethernet/xilinx/xilinx_tsn_ptp_clock.c: In function 'xlnx_rtc_offset_write':
>> drivers/net/ethernet/xilinx/xilinx_tsn_ptp_clock.c:58:9: error: implicit declaration of function 'out_be32' [-Werror=implicit-function-declaration]
58 | out_be32((timer->baseaddr + XTIMER1588_RTC_OFFSET_SEC_H), 0);
| ^~~~~~~~
cc1: some warnings being treated as errors
vim +/in_be32 +46 drivers/net/ethernet/xilinx/xilinx_tsn_ptp_clock.c
41
42 static void xlnx_tod_read(struct xlnx_ptp_timer *timer, struct timespec64 *ts)
43 {
44 u32 sec, nsec;
45
> 46 nsec = in_be32(timer->baseaddr + XTIMER1588_CURRENT_RTC_NS);
47 sec = in_be32(timer->baseaddr + XTIMER1588_CURRENT_RTC_SEC_L);
48
49 ts->tv_sec = sec;
50 ts->tv_nsec = nsec;
51 }
52
53 static void xlnx_rtc_offset_write(struct xlnx_ptp_timer *timer,
54 const struct timespec64 *ts)
55 {
56 pr_debug("%s: sec: %lld nsec: %ld\n", __func__, ts->tv_sec, ts->tv_nsec);
57
> 58 out_be32((timer->baseaddr + XTIMER1588_RTC_OFFSET_SEC_H), 0);
59 out_be32((timer->baseaddr + XTIMER1588_RTC_OFFSET_SEC_L),
60 (ts->tv_sec));
61 out_be32((timer->baseaddr + XTIMER1588_RTC_OFFSET_NS), ts->tv_nsec);
62 }
63
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months
Re: [PATCH v1 1/1] crypto: cavium/nitrox - don't cast parameter in bit operations
by kernel test robot
Hi Andy,
I love your patch! Yet something to improve:
[auto build test ERROR on herbert-cryptodev-2.6/master]
[also build test ERROR on herbert-crypto-2.6/master linux/master linus/master v5.17-rc4 next-20220215]
[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/Andy-Shevchenko/crypto-cavium-ni...
base: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
config: x86_64-rhel-8.3 (https://download.01.org/0day-ci/archive/20220216/202202160443.hqpSAgbP-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/51e27f6f33d377023ec5e097d18acb18f...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Andy-Shevchenko/crypto-cavium-nitrox-don-t-cast-parameter-in-bit-operations/20220216-000941
git checkout 51e27f6f33d377023ec5e097d18acb18f992f551
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/crypto/cavium/nitrox/
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 >>):
drivers/crypto/cavium/nitrox/nitrox_mbx.c: In function 'nitrox_pf2vf_mbox_handler':
>> drivers/crypto/cavium/nitrox/nitrox_mbx.c:126:2: error: implicit declaration of function 'DEFINE_BITMAP'; did you mean 'DEFINE_TIMER'? [-Werror=implicit-function-declaration]
126 | DEFINE_BITMAP(csr, 64);
| ^~~~~~~~~~~~~
| DEFINE_TIMER
>> drivers/crypto/cavium/nitrox/nitrox_mbx.c:126:16: error: 'csr' undeclared (first use in this function); did you mean 'msr'?
126 | DEFINE_BITMAP(csr, 64);
| ^~~
| msr
drivers/crypto/cavium/nitrox/nitrox_mbx.c:126:16: note: each undeclared identifier is reported only once for each function it appears in
drivers/crypto/cavium/nitrox/nitrox_mbx.c:127:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
127 | u64 value, reg_addr;
| ^~~
cc1: some warnings being treated as errors
vim +126 drivers/crypto/cavium/nitrox/nitrox_mbx.c
121
122 void nitrox_pf2vf_mbox_handler(struct nitrox_device *ndev)
123 {
124 struct nitrox_vfdev *vfdev;
125 struct pf2vf_work *pfwork;
> 126 DEFINE_BITMAP(csr, 64);
127 u64 value, reg_addr;
128 u32 i;
129 int vfno;
130
131 /* loop for VF(0..63) */
132 reg_addr = NPS_PKT_MBOX_INT_LO;
133 value = nitrox_read_csr(ndev, reg_addr);
134 bitmap_from_u64(csr, value);
135 for_each_set_bit(i, csr, BITS_PER_TYPE(csr)) {
136 /* get the vfno from ring */
137 vfno = RING_TO_VFNO(i, ndev->iov.max_vf_queues);
138 vfdev = ndev->iov.vfdev + vfno;
139 vfdev->ring = i;
140 /* fill the vf mailbox data */
141 vfdev->msg.value = pf2vf_read_mbox(ndev, vfdev->ring);
142 pfwork = kzalloc(sizeof(*pfwork), GFP_ATOMIC);
143 if (!pfwork)
144 continue;
145
146 pfwork->vfdev = vfdev;
147 pfwork->ndev = ndev;
148 INIT_WORK(&pfwork->pf2vf_resp, pf2vf_resp_handler);
149 queue_work(ndev->iov.pf2vf_wq, &pfwork->pf2vf_resp);
150 /* clear the corresponding vf bit */
151 nitrox_write_csr(ndev, reg_addr, BIT_ULL(i));
152 }
153
154 /* loop for VF(64..127) */
155 reg_addr = NPS_PKT_MBOX_INT_HI;
156 value = nitrox_read_csr(ndev, reg_addr);
157 bitmap_from_u64(csr, value);
158 for_each_set_bit(i, csr, BITS_PER_TYPE(csr)) {
159 /* get the vfno from ring */
160 vfno = RING_TO_VFNO(i + 64, ndev->iov.max_vf_queues);
161 vfdev = ndev->iov.vfdev + vfno;
162 vfdev->ring = (i + 64);
163 /* fill the vf mailbox data */
164 vfdev->msg.value = pf2vf_read_mbox(ndev, vfdev->ring);
165
166 pfwork = kzalloc(sizeof(*pfwork), GFP_ATOMIC);
167 if (!pfwork)
168 continue;
169
170 pfwork->vfdev = vfdev;
171 pfwork->ndev = ndev;
172 INIT_WORK(&pfwork->pf2vf_resp, pf2vf_resp_handler);
173 queue_work(ndev->iov.pf2vf_wq, &pfwork->pf2vf_resp);
174 /* clear the corresponding vf bit */
175 nitrox_write_csr(ndev, reg_addr, BIT_ULL(i));
176 }
177 }
178
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months
[kdave-btrfs-devel:misc-next 68/68] fs/btrfs/ioctl.c:1192: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
by kernel test robot
tree: https://github.com/kdave/btrfs-devel.git misc-next
head: e6c69fcbee7ef1d7bde4ff78eb1377dbe09d71cf
commit: e6c69fcbee7ef1d7bde4ff78eb1377dbe09d71cf [68/68] btrfs: defrag: use control structure in btrfs_defrag_file()
config: arm64-randconfig-r036-20220214 (https://download.01.org/0day-ci/archive/20220216/202202160409.lvaZWYmg-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 37f422f4ac31c8b8041c6b62065263314282dab6)
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://github.com/kdave/btrfs-devel/commit/e6c69fcbee7ef1d7bde4ff78eb137...
git remote add kdave-btrfs-devel https://github.com/kdave/btrfs-devel.git
git fetch --no-tags kdave-btrfs-devel misc-next
git checkout e6c69fcbee7ef1d7bde4ff78eb1377dbe09d71cf
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/mfd/ fs/btrfs/ mm/kasan/
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/ioctl.c:1192: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
* Collect all valid target extents.
fs/btrfs/ioctl.c:1598: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
* Entry point to file defragmentation.
vim +1192 fs/btrfs/ioctl.c
4cb5300bc839b8a Chris Mason 2011-05-24 1190
e6c69fcbee7ef1d Qu Wenruo 2022-02-11 1191 /**
eb793cf857828db Qu Wenruo 2021-08-06 @1192 * Collect all valid target extents.
eb793cf857828db Qu Wenruo 2021-08-06 1193 *
e6c69fcbee7ef1d Qu Wenruo 2022-02-11 1194 * @inode: inode to defragment
e6c69fcbee7ef1d Qu Wenruo 2022-02-11 1195 * @ctrl: extra defrag policy control
eb793cf857828db Qu Wenruo 2021-08-06 1196 * @start: file offset to lookup
eb793cf857828db Qu Wenruo 2021-08-06 1197 * @len: length to lookup
e9eec72151e215c Qu Wenruo 2021-08-06 1198 * @locked: if the range has already held extent lock
eb793cf857828db Qu Wenruo 2021-08-06 1199 * @target_list: list of targets file extents
e6c69fcbee7ef1d Qu Wenruo 2022-02-11 1200 *
e6c69fcbee7ef1d Qu Wenruo 2022-02-11 1201 * Will update ctrl::last_scanned.
4cb5300bc839b8a Chris Mason 2011-05-24 1202 */
eb793cf857828db Qu Wenruo 2021-08-06 1203 static int defrag_collect_targets(struct btrfs_inode *inode,
e6c69fcbee7ef1d Qu Wenruo 2022-02-11 1204 struct btrfs_defrag_ctrl *ctrl,
e6c69fcbee7ef1d Qu Wenruo 2022-02-11 1205 u64 start, u32 len,
e6c69fcbee7ef1d Qu Wenruo 2022-02-11 1206 bool locked, struct list_head *target_list)
eb793cf857828db Qu Wenruo 2021-08-06 1207 {
e6c69fcbee7ef1d Qu Wenruo 2022-02-11 1208 bool do_compress = (ctrl->flags & BTRFS_DEFRAG_RANGE_COMPRESS);
c0a67d1ead1393b Qu Wenruo 2022-02-11 1209 bool last_is_target = false;
eb793cf857828db Qu Wenruo 2021-08-06 1210 u64 cur = start;
eb793cf857828db Qu Wenruo 2021-08-06 1211 int ret = 0;
4cb5300bc839b8a Chris Mason 2011-05-24 1212
eb793cf857828db Qu Wenruo 2021-08-06 1213 while (cur < start + len) {
eb793cf857828db Qu Wenruo 2021-08-06 1214 struct extent_map *em;
eb793cf857828db Qu Wenruo 2021-08-06 1215 struct defrag_target_range *new;
eb793cf857828db Qu Wenruo 2021-08-06 1216 bool next_mergeable = true;
eb793cf857828db Qu Wenruo 2021-08-06 1217 u64 range_len;
eb793cf857828db Qu Wenruo 2021-08-06 1218
c0a67d1ead1393b Qu Wenruo 2022-02-11 1219 last_is_target = false;
e9eec72151e215c Qu Wenruo 2021-08-06 1220 em = defrag_lookup_extent(&inode->vfs_inode, cur, locked);
eb793cf857828db Qu Wenruo 2021-08-06 1221 if (!em)
eb793cf857828db Qu Wenruo 2021-08-06 1222 break;
eb793cf857828db Qu Wenruo 2021-08-06 1223
eb793cf857828db Qu Wenruo 2021-08-06 1224 /* Skip hole/inline/preallocated extents */
eb793cf857828db Qu Wenruo 2021-08-06 1225 if (em->block_start >= EXTENT_MAP_LAST_BYTE ||
eb793cf857828db Qu Wenruo 2021-08-06 1226 test_bit(EXTENT_FLAG_PREALLOC, &em->flags))
eb793cf857828db Qu Wenruo 2021-08-06 1227 goto next;
4cb5300bc839b8a Chris Mason 2011-05-24 1228
eb793cf857828db Qu Wenruo 2021-08-06 1229 /* Skip older extent */
e6c69fcbee7ef1d Qu Wenruo 2022-02-11 1230 if (em->generation < ctrl->newer_than)
eb793cf857828db Qu Wenruo 2021-08-06 1231 goto next;
7f458a3873ae94e Filipe Manana 2020-11-04 1232
79c19b4d71f61a3 Qu Wenruo 2022-02-08 1233 /* This em is under writeback, no need to defrag */
79c19b4d71f61a3 Qu Wenruo 2022-02-08 1234 if (em->generation == (u64)-1)
79c19b4d71f61a3 Qu Wenruo 2022-02-08 1235 goto next;
79c19b4d71f61a3 Qu Wenruo 2022-02-08 1236
0cb5950f3f3b51a Filipe Manana 2022-01-20 1237 /*
0cb5950f3f3b51a Filipe Manana 2022-01-20 1238 * Our start offset might be in the middle of an existing extent
0cb5950f3f3b51a Filipe Manana 2022-01-20 1239 * map, so take that into account.
0cb5950f3f3b51a Filipe Manana 2022-01-20 1240 */
0cb5950f3f3b51a Filipe Manana 2022-01-20 1241 range_len = em->len - (cur - em->start);
0cb5950f3f3b51a Filipe Manana 2022-01-20 1242 /*
0cb5950f3f3b51a Filipe Manana 2022-01-20 1243 * If this range of the extent map is already flagged for delalloc,
0cb5950f3f3b51a Filipe Manana 2022-01-20 1244 * skip it, because:
0cb5950f3f3b51a Filipe Manana 2022-01-20 1245 *
0cb5950f3f3b51a Filipe Manana 2022-01-20 1246 * 1) We could deadlock later, when trying to reserve space for
0cb5950f3f3b51a Filipe Manana 2022-01-20 1247 * delalloc, because in case we can't immediately reserve space
0cb5950f3f3b51a Filipe Manana 2022-01-20 1248 * the flusher can start delalloc and wait for the respective
0cb5950f3f3b51a Filipe Manana 2022-01-20 1249 * ordered extents to complete. The deadlock would happen
0cb5950f3f3b51a Filipe Manana 2022-01-20 1250 * because we do the space reservation while holding the range
0cb5950f3f3b51a Filipe Manana 2022-01-20 1251 * locked, and starting writeback, or finishing an ordered
0cb5950f3f3b51a Filipe Manana 2022-01-20 1252 * extent, requires locking the range;
0cb5950f3f3b51a Filipe Manana 2022-01-20 1253 *
0cb5950f3f3b51a Filipe Manana 2022-01-20 1254 * 2) If there's delalloc there, it means there's dirty pages for
0cb5950f3f3b51a Filipe Manana 2022-01-20 1255 * which writeback has not started yet (we clean the delalloc
0cb5950f3f3b51a Filipe Manana 2022-01-20 1256 * flag when starting writeback and after creating an ordered
0cb5950f3f3b51a Filipe Manana 2022-01-20 1257 * extent). If we mark pages in an adjacent range for defrag,
0cb5950f3f3b51a Filipe Manana 2022-01-20 1258 * then we will have a larger contiguous range for delalloc,
0cb5950f3f3b51a Filipe Manana 2022-01-20 1259 * very likely resulting in a larger extent after writeback is
0cb5950f3f3b51a Filipe Manana 2022-01-20 1260 * triggered (except in a case of free space fragmentation).
0cb5950f3f3b51a Filipe Manana 2022-01-20 1261 */
0cb5950f3f3b51a Filipe Manana 2022-01-20 1262 if (test_range_bit(&inode->io_tree, cur, cur + range_len - 1,
0cb5950f3f3b51a Filipe Manana 2022-01-20 1263 EXTENT_DELALLOC, 0, NULL))
0cb5950f3f3b51a Filipe Manana 2022-01-20 1264 goto next;
0cb5950f3f3b51a Filipe Manana 2022-01-20 1265
7f458a3873ae94e Filipe Manana 2020-11-04 1266 /*
eb793cf857828db Qu Wenruo 2021-08-06 1267 * For do_compress case, we want to compress all valid file
eb793cf857828db Qu Wenruo 2021-08-06 1268 * extents, thus no @extent_thresh or mergeable check.
7f458a3873ae94e Filipe Manana 2020-11-04 1269 */
eb793cf857828db Qu Wenruo 2021-08-06 1270 if (do_compress)
eb793cf857828db Qu Wenruo 2021-08-06 1271 goto add;
eb793cf857828db Qu Wenruo 2021-08-06 1272
eb793cf857828db Qu Wenruo 2021-08-06 1273 /* Skip too large extent */
e6c69fcbee7ef1d Qu Wenruo 2022-02-11 1274 if (range_len >= ctrl->extent_thresh)
eb793cf857828db Qu Wenruo 2021-08-06 1275 goto next;
eb793cf857828db Qu Wenruo 2021-08-06 1276
c55eaee8366f0b9 Qu Wenruo 2022-01-28 1277 /*
c55eaee8366f0b9 Qu Wenruo 2022-01-28 1278 * Skip extents already at its max capacity, this is mostly for
c55eaee8366f0b9 Qu Wenruo 2022-01-28 1279 * compressed extents, which max cap is only 128K.
c55eaee8366f0b9 Qu Wenruo 2022-01-28 1280 */
c55eaee8366f0b9 Qu Wenruo 2022-01-28 1281 if (em->len >= get_extent_max_capacity(em))
c55eaee8366f0b9 Qu Wenruo 2022-01-28 1282 goto next;
c55eaee8366f0b9 Qu Wenruo 2022-01-28 1283
e9eec72151e215c Qu Wenruo 2021-08-06 1284 next_mergeable = defrag_check_next_extent(&inode->vfs_inode, em,
e9eec72151e215c Qu Wenruo 2021-08-06 1285 locked);
eb793cf857828db Qu Wenruo 2021-08-06 1286 if (!next_mergeable) {
eb793cf857828db Qu Wenruo 2021-08-06 1287 struct defrag_target_range *last;
eb793cf857828db Qu Wenruo 2021-08-06 1288
eb793cf857828db Qu Wenruo 2021-08-06 1289 /* Empty target list, no way to merge with last entry */
eb793cf857828db Qu Wenruo 2021-08-06 1290 if (list_empty(target_list))
eb793cf857828db Qu Wenruo 2021-08-06 1291 goto next;
eb793cf857828db Qu Wenruo 2021-08-06 1292 last = list_entry(target_list->prev,
eb793cf857828db Qu Wenruo 2021-08-06 1293 struct defrag_target_range, list);
eb793cf857828db Qu Wenruo 2021-08-06 1294 /* Not mergeable with last entry */
eb793cf857828db Qu Wenruo 2021-08-06 1295 if (last->start + last->len != cur)
eb793cf857828db Qu Wenruo 2021-08-06 1296 goto next;
7f458a3873ae94e Filipe Manana 2020-11-04 1297
eb793cf857828db Qu Wenruo 2021-08-06 1298 /* Mergeable, fall through to add it to @target_list. */
7f458a3873ae94e Filipe Manana 2020-11-04 1299 }
eb793cf857828db Qu Wenruo 2021-08-06 1300
eb793cf857828db Qu Wenruo 2021-08-06 1301 add:
c0a67d1ead1393b Qu Wenruo 2022-02-11 1302 last_is_target = true;
eb793cf857828db Qu Wenruo 2021-08-06 1303 range_len = min(extent_map_end(em), start + len) - cur;
eb793cf857828db Qu Wenruo 2021-08-06 1304 /*
eb793cf857828db Qu Wenruo 2021-08-06 1305 * This one is a good target, check if it can be merged into
eb793cf857828db Qu Wenruo 2021-08-06 1306 * last range of the target list.
eb793cf857828db Qu Wenruo 2021-08-06 1307 */
eb793cf857828db Qu Wenruo 2021-08-06 1308 if (!list_empty(target_list)) {
eb793cf857828db Qu Wenruo 2021-08-06 1309 struct defrag_target_range *last;
eb793cf857828db Qu Wenruo 2021-08-06 1310
eb793cf857828db Qu Wenruo 2021-08-06 1311 last = list_entry(target_list->prev,
eb793cf857828db Qu Wenruo 2021-08-06 1312 struct defrag_target_range, list);
eb793cf857828db Qu Wenruo 2021-08-06 1313 ASSERT(last->start + last->len <= cur);
eb793cf857828db Qu Wenruo 2021-08-06 1314 if (last->start + last->len == cur) {
eb793cf857828db Qu Wenruo 2021-08-06 1315 /* Mergeable, enlarge the last entry */
eb793cf857828db Qu Wenruo 2021-08-06 1316 last->len += range_len;
eb793cf857828db Qu Wenruo 2021-08-06 1317 goto next;
7f458a3873ae94e Filipe Manana 2020-11-04 1318 }
eb793cf857828db Qu Wenruo 2021-08-06 1319 /* Fall through to allocate a new entry */
eb793cf857828db Qu Wenruo 2021-08-06 1320 }
eb793cf857828db Qu Wenruo 2021-08-06 1321
eb793cf857828db Qu Wenruo 2021-08-06 1322 /* Allocate new defrag_target_range */
eb793cf857828db Qu Wenruo 2021-08-06 1323 new = kmalloc(sizeof(*new), GFP_NOFS);
eb793cf857828db Qu Wenruo 2021-08-06 1324 if (!new) {
7f458a3873ae94e Filipe Manana 2020-11-04 1325 free_extent_map(em);
eb793cf857828db Qu Wenruo 2021-08-06 1326 ret = -ENOMEM;
eb793cf857828db Qu Wenruo 2021-08-06 1327 break;
7f458a3873ae94e Filipe Manana 2020-11-04 1328 }
eb793cf857828db Qu Wenruo 2021-08-06 1329 new->start = cur;
eb793cf857828db Qu Wenruo 2021-08-06 1330 new->len = range_len;
eb793cf857828db Qu Wenruo 2021-08-06 1331 list_add_tail(&new->list, target_list);
7f458a3873ae94e Filipe Manana 2020-11-04 1332
eb793cf857828db Qu Wenruo 2021-08-06 1333 next:
eb793cf857828db Qu Wenruo 2021-08-06 1334 cur = extent_map_end(em);
eb793cf857828db Qu Wenruo 2021-08-06 1335 free_extent_map(em);
eb793cf857828db Qu Wenruo 2021-08-06 1336 }
eb793cf857828db Qu Wenruo 2021-08-06 1337 if (ret < 0) {
eb793cf857828db Qu Wenruo 2021-08-06 1338 struct defrag_target_range *entry;
eb793cf857828db Qu Wenruo 2021-08-06 1339 struct defrag_target_range *tmp;
4cb5300bc839b8a Chris Mason 2011-05-24 1340
eb793cf857828db Qu Wenruo 2021-08-06 1341 list_for_each_entry_safe(entry, tmp, target_list, list) {
eb793cf857828db Qu Wenruo 2021-08-06 1342 list_del_init(&entry->list);
eb793cf857828db Qu Wenruo 2021-08-06 1343 kfree(entry);
eb793cf857828db Qu Wenruo 2021-08-06 1344 }
eb793cf857828db Qu Wenruo 2021-08-06 1345 }
e6c69fcbee7ef1d Qu Wenruo 2022-02-11 1346 if (!ret) {
c0a67d1ead1393b Qu Wenruo 2022-02-11 1347 /*
c0a67d1ead1393b Qu Wenruo 2022-02-11 1348 * If the last extent is not a target, the caller can skip to
c0a67d1ead1393b Qu Wenruo 2022-02-11 1349 * the end of that extent.
c0a67d1ead1393b Qu Wenruo 2022-02-11 1350 * Otherwise, we can only go the end of the specified range.
e6c69fcbee7ef1d Qu Wenruo 2022-02-11 1351 *
e6c69fcbee7ef1d Qu Wenruo 2022-02-11 1352 * And we may got a range smaller than current
e6c69fcbee7ef1d Qu Wenruo 2022-02-11 1353 * ctrl->last_scanned (e.g. executed in the defrag_one_range
e6c69fcbee7ef1d Qu Wenruo 2022-02-11 1354 * call), so we have to ensure we didn't decrease
e6c69fcbee7ef1d Qu Wenruo 2022-02-11 1355 * ctrl->last_scanned.
c0a67d1ead1393b Qu Wenruo 2022-02-11 1356 */
c0a67d1ead1393b Qu Wenruo 2022-02-11 1357 if (!last_is_target)
e6c69fcbee7ef1d Qu Wenruo 2022-02-11 1358 ctrl->last_scanned = max(cur, ctrl->last_scanned);
c0a67d1ead1393b Qu Wenruo 2022-02-11 1359 else
e6c69fcbee7ef1d Qu Wenruo 2022-02-11 1360 ctrl->last_scanned = max(start + len, ctrl->last_scanned);
c0a67d1ead1393b Qu Wenruo 2022-02-11 1361 }
eb793cf857828db Qu Wenruo 2021-08-06 1362 return ret;
4cb5300bc839b8a Chris Mason 2011-05-24 1363 }
4cb5300bc839b8a Chris Mason 2011-05-24 1364
:::::: The code at line 1192 was first introduced by commit
:::::: eb793cf857828dbb1f21bfe405e5e493fdceae6c btrfs: defrag: introduce helper to collect target file extents
:::::: TO: Qu Wenruo <wqu(a)suse.com>
:::::: CC: David Sterba <dsterba(a)suse.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months