Re: [PATCH] nl80211: limit band information in non-split data
by kernel test robot
Hi Johannes,
I love your patch! Perhaps something to improve:
[auto build test WARNING on mac80211-next/master]
[also build test WARNING on mac80211/master v5.14-rc1 next-20210712]
[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/Johannes-Berg/nl80211-limit-band...
base: https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git master
config: i386-randconfig-a015-20210712 (attached as .config)
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/8b9f518558f83c5997dd9d6789623641e...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Johannes-Berg/nl80211-limit-band-information-in-non-split-data/20210713-035535
git checkout 8b9f518558f83c5997dd9d6789623641ee5854b5
# save the attached .config to linux build tree
make W=1 ARCH=i386
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/wireless/nl80211.c: In function 'nl80211_send_wiphy':
>> net/wireless/nl80211.c:2355:23: warning: ?: using integer constants in boolean context, the expression will always evaluate to 'true' [-Wint-in-bool-context]
2354 | band < state->split ?
| ~~~~~~~~~~~~~~~~~~~~~
2355 | NUM_NL80211_BANDS :
| ~~~~~~~~~~~~~~~~~~^
2356 | NL80211_BAND_60GHZ + 1;
| ~~~~~~~~~~~~~~~~~~~~~~
vim +/true +2355 net/wireless/nl80211.c
2212
2213 static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
2214 enum nl80211_commands cmd,
2215 struct sk_buff *msg, u32 portid, u32 seq,
2216 int flags, struct nl80211_dump_wiphy_state *state)
2217 {
2218 void *hdr;
2219 struct nlattr *nl_bands, *nl_band;
2220 struct nlattr *nl_freqs, *nl_freq;
2221 struct nlattr *nl_cmds;
2222 enum nl80211_band band;
2223 struct ieee80211_channel *chan;
2224 int i;
2225 const struct ieee80211_txrx_stypes *mgmt_stypes =
2226 rdev->wiphy.mgmt_stypes;
2227 u32 features;
2228
2229 hdr = nl80211hdr_put(msg, portid, seq, flags, cmd);
2230 if (!hdr)
2231 return -ENOBUFS;
2232
2233 if (WARN_ON(!state))
2234 return -EINVAL;
2235
2236 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
2237 nla_put_string(msg, NL80211_ATTR_WIPHY_NAME,
2238 wiphy_name(&rdev->wiphy)) ||
2239 nla_put_u32(msg, NL80211_ATTR_GENERATION,
2240 cfg80211_rdev_list_generation))
2241 goto nla_put_failure;
2242
2243 if (cmd != NL80211_CMD_NEW_WIPHY)
2244 goto finish;
2245
2246 switch (state->split_start) {
2247 case 0:
2248 if (nla_put_u8(msg, NL80211_ATTR_WIPHY_RETRY_SHORT,
2249 rdev->wiphy.retry_short) ||
2250 nla_put_u8(msg, NL80211_ATTR_WIPHY_RETRY_LONG,
2251 rdev->wiphy.retry_long) ||
2252 nla_put_u32(msg, NL80211_ATTR_WIPHY_FRAG_THRESHOLD,
2253 rdev->wiphy.frag_threshold) ||
2254 nla_put_u32(msg, NL80211_ATTR_WIPHY_RTS_THRESHOLD,
2255 rdev->wiphy.rts_threshold) ||
2256 nla_put_u8(msg, NL80211_ATTR_WIPHY_COVERAGE_CLASS,
2257 rdev->wiphy.coverage_class) ||
2258 nla_put_u8(msg, NL80211_ATTR_MAX_NUM_SCAN_SSIDS,
2259 rdev->wiphy.max_scan_ssids) ||
2260 nla_put_u8(msg, NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS,
2261 rdev->wiphy.max_sched_scan_ssids) ||
2262 nla_put_u16(msg, NL80211_ATTR_MAX_SCAN_IE_LEN,
2263 rdev->wiphy.max_scan_ie_len) ||
2264 nla_put_u16(msg, NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN,
2265 rdev->wiphy.max_sched_scan_ie_len) ||
2266 nla_put_u8(msg, NL80211_ATTR_MAX_MATCH_SETS,
2267 rdev->wiphy.max_match_sets))
2268 goto nla_put_failure;
2269
2270 if ((rdev->wiphy.flags & WIPHY_FLAG_IBSS_RSN) &&
2271 nla_put_flag(msg, NL80211_ATTR_SUPPORT_IBSS_RSN))
2272 goto nla_put_failure;
2273 if ((rdev->wiphy.flags & WIPHY_FLAG_MESH_AUTH) &&
2274 nla_put_flag(msg, NL80211_ATTR_SUPPORT_MESH_AUTH))
2275 goto nla_put_failure;
2276 if ((rdev->wiphy.flags & WIPHY_FLAG_AP_UAPSD) &&
2277 nla_put_flag(msg, NL80211_ATTR_SUPPORT_AP_UAPSD))
2278 goto nla_put_failure;
2279 if ((rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_FW_ROAM) &&
2280 nla_put_flag(msg, NL80211_ATTR_ROAM_SUPPORT))
2281 goto nla_put_failure;
2282 if ((rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_TDLS) &&
2283 nla_put_flag(msg, NL80211_ATTR_TDLS_SUPPORT))
2284 goto nla_put_failure;
2285 if ((rdev->wiphy.flags & WIPHY_FLAG_TDLS_EXTERNAL_SETUP) &&
2286 nla_put_flag(msg, NL80211_ATTR_TDLS_EXTERNAL_SETUP))
2287 goto nla_put_failure;
2288 state->split_start++;
2289 if (state->split)
2290 break;
2291 fallthrough;
2292 case 1:
2293 if (nla_put(msg, NL80211_ATTR_CIPHER_SUITES,
2294 sizeof(u32) * rdev->wiphy.n_cipher_suites,
2295 rdev->wiphy.cipher_suites))
2296 goto nla_put_failure;
2297
2298 if (nla_put_u8(msg, NL80211_ATTR_MAX_NUM_PMKIDS,
2299 rdev->wiphy.max_num_pmkids))
2300 goto nla_put_failure;
2301
2302 if ((rdev->wiphy.flags & WIPHY_FLAG_CONTROL_PORT_PROTOCOL) &&
2303 nla_put_flag(msg, NL80211_ATTR_CONTROL_PORT_ETHERTYPE))
2304 goto nla_put_failure;
2305
2306 if (nla_put_u32(msg, NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX,
2307 rdev->wiphy.available_antennas_tx) ||
2308 nla_put_u32(msg, NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX,
2309 rdev->wiphy.available_antennas_rx))
2310 goto nla_put_failure;
2311
2312 if ((rdev->wiphy.flags & WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD) &&
2313 nla_put_u32(msg, NL80211_ATTR_PROBE_RESP_OFFLOAD,
2314 rdev->wiphy.probe_resp_offload))
2315 goto nla_put_failure;
2316
2317 if ((rdev->wiphy.available_antennas_tx ||
2318 rdev->wiphy.available_antennas_rx) &&
2319 rdev->ops->get_antenna) {
2320 u32 tx_ant = 0, rx_ant = 0;
2321 int res;
2322
2323 res = rdev_get_antenna(rdev, &tx_ant, &rx_ant);
2324 if (!res) {
2325 if (nla_put_u32(msg,
2326 NL80211_ATTR_WIPHY_ANTENNA_TX,
2327 tx_ant) ||
2328 nla_put_u32(msg,
2329 NL80211_ATTR_WIPHY_ANTENNA_RX,
2330 rx_ant))
2331 goto nla_put_failure;
2332 }
2333 }
2334
2335 state->split_start++;
2336 if (state->split)
2337 break;
2338 fallthrough;
2339 case 2:
2340 if (nl80211_put_iftypes(msg, NL80211_ATTR_SUPPORTED_IFTYPES,
2341 rdev->wiphy.interface_modes))
2342 goto nla_put_failure;
2343 state->split_start++;
2344 if (state->split)
2345 break;
2346 fallthrough;
2347 case 3:
2348 nl_bands = nla_nest_start_noflag(msg,
2349 NL80211_ATTR_WIPHY_BANDS);
2350 if (!nl_bands)
2351 goto nla_put_failure;
2352
2353 for (band = state->band_start;
2354 band < state->split ?
> 2355 NUM_NL80211_BANDS :
2356 NL80211_BAND_60GHZ + 1;
2357 band++) {
2358 struct ieee80211_supported_band *sband;
2359
2360 /* omit higher bands for ancient software */
2361 if (band > NL80211_BAND_5GHZ && !state->split)
2362 break;
2363
2364 sband = rdev->wiphy.bands[band];
2365
2366 if (!sband)
2367 continue;
2368
2369 nl_band = nla_nest_start_noflag(msg, band);
2370 if (!nl_band)
2371 goto nla_put_failure;
2372
2373 switch (state->chan_start) {
2374 case 0:
2375 if (nl80211_send_band_rateinfo(msg, sband,
2376 state->split))
2377 goto nla_put_failure;
2378 state->chan_start++;
2379 if (state->split)
2380 break;
2381 fallthrough;
2382 default:
2383 /* add frequencies */
2384 nl_freqs = nla_nest_start_noflag(msg,
2385 NL80211_BAND_ATTR_FREQS);
2386 if (!nl_freqs)
2387 goto nla_put_failure;
2388
2389 for (i = state->chan_start - 1;
2390 i < sband->n_channels;
2391 i++) {
2392 nl_freq = nla_nest_start_noflag(msg,
2393 i);
2394 if (!nl_freq)
2395 goto nla_put_failure;
2396
2397 chan = &sband->channels[i];
2398
2399 if (nl80211_msg_put_channel(
2400 msg, &rdev->wiphy, chan,
2401 state->split))
2402 goto nla_put_failure;
2403
2404 nla_nest_end(msg, nl_freq);
2405 if (state->split)
2406 break;
2407 }
2408 if (i < sband->n_channels)
2409 state->chan_start = i + 2;
2410 else
2411 state->chan_start = 0;
2412 nla_nest_end(msg, nl_freqs);
2413 }
2414
2415 nla_nest_end(msg, nl_band);
2416
2417 if (state->split) {
2418 /* start again here */
2419 if (state->chan_start)
2420 band--;
2421 break;
2422 }
2423 }
2424 nla_nest_end(msg, nl_bands);
2425
2426 if (band < NUM_NL80211_BANDS)
2427 state->band_start = band + 1;
2428 else
2429 state->band_start = 0;
2430
2431 /* if bands & channels are done, continue outside */
2432 if (state->band_start == 0 && state->chan_start == 0)
2433 state->split_start++;
2434 if (state->split)
2435 break;
2436 fallthrough;
2437 case 4:
2438 nl_cmds = nla_nest_start_noflag(msg,
2439 NL80211_ATTR_SUPPORTED_COMMANDS);
2440 if (!nl_cmds)
2441 goto nla_put_failure;
2442
2443 i = nl80211_add_commands_unsplit(rdev, msg);
2444 if (i < 0)
2445 goto nla_put_failure;
2446 if (state->split) {
2447 CMD(crit_proto_start, CRIT_PROTOCOL_START);
2448 CMD(crit_proto_stop, CRIT_PROTOCOL_STOP);
2449 if (rdev->wiphy.flags & WIPHY_FLAG_HAS_CHANNEL_SWITCH)
2450 CMD(channel_switch, CHANNEL_SWITCH);
2451 CMD(set_qos_map, SET_QOS_MAP);
2452 if (rdev->wiphy.features &
2453 NL80211_FEATURE_SUPPORTS_WMM_ADMISSION)
2454 CMD(add_tx_ts, ADD_TX_TS);
2455 CMD(set_multicast_to_unicast, SET_MULTICAST_TO_UNICAST);
2456 CMD(update_connect_params, UPDATE_CONNECT_PARAMS);
2457 CMD(update_ft_ies, UPDATE_FT_IES);
2458 if (rdev->wiphy.sar_capa)
2459 CMD(set_sar_specs, SET_SAR_SPECS);
2460 }
2461 #undef CMD
2462
2463 nla_nest_end(msg, nl_cmds);
2464 state->split_start++;
2465 if (state->split)
2466 break;
2467 fallthrough;
2468 case 5:
2469 if (rdev->ops->remain_on_channel &&
2470 (rdev->wiphy.flags & WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL) &&
2471 nla_put_u32(msg,
2472 NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION,
2473 rdev->wiphy.max_remain_on_channel_duration))
2474 goto nla_put_failure;
2475
2476 if ((rdev->wiphy.flags & WIPHY_FLAG_OFFCHAN_TX) &&
2477 nla_put_flag(msg, NL80211_ATTR_OFFCHANNEL_TX_OK))
2478 goto nla_put_failure;
2479
2480 state->split_start++;
2481 if (state->split)
2482 break;
2483 fallthrough;
2484 case 6:
2485 #ifdef CONFIG_PM
2486 if (nl80211_send_wowlan(msg, rdev, state->split))
2487 goto nla_put_failure;
2488 state->split_start++;
2489 if (state->split)
2490 break;
2491 #else
2492 state->split_start++;
2493 #endif
2494 fallthrough;
2495 case 7:
2496 if (nl80211_put_iftypes(msg, NL80211_ATTR_SOFTWARE_IFTYPES,
2497 rdev->wiphy.software_iftypes))
2498 goto nla_put_failure;
2499
2500 if (nl80211_put_iface_combinations(&rdev->wiphy, msg,
2501 state->split))
2502 goto nla_put_failure;
2503
2504 state->split_start++;
2505 if (state->split)
2506 break;
2507 fallthrough;
2508 case 8:
2509 if ((rdev->wiphy.flags & WIPHY_FLAG_HAVE_AP_SME) &&
2510 nla_put_u32(msg, NL80211_ATTR_DEVICE_AP_SME,
2511 rdev->wiphy.ap_sme_capa))
2512 goto nla_put_failure;
2513
2514 features = rdev->wiphy.features;
2515 /*
2516 * We can only add the per-channel limit information if the
2517 * dump is split, otherwise it makes it too big. Therefore
2518 * only advertise it in that case.
2519 */
2520 if (state->split)
2521 features |= NL80211_FEATURE_ADVERTISE_CHAN_LIMITS;
2522 if (nla_put_u32(msg, NL80211_ATTR_FEATURE_FLAGS, features))
2523 goto nla_put_failure;
2524
2525 if (rdev->wiphy.ht_capa_mod_mask &&
2526 nla_put(msg, NL80211_ATTR_HT_CAPABILITY_MASK,
2527 sizeof(*rdev->wiphy.ht_capa_mod_mask),
2528 rdev->wiphy.ht_capa_mod_mask))
2529 goto nla_put_failure;
2530
2531 if (rdev->wiphy.flags & WIPHY_FLAG_HAVE_AP_SME &&
2532 rdev->wiphy.max_acl_mac_addrs &&
2533 nla_put_u32(msg, NL80211_ATTR_MAC_ACL_MAX,
2534 rdev->wiphy.max_acl_mac_addrs))
2535 goto nla_put_failure;
2536
2537 /*
2538 * Any information below this point is only available to
2539 * applications that can deal with it being split. This
2540 * helps ensure that newly added capabilities don't break
2541 * older tools by overrunning their buffers.
2542 *
2543 * We still increment split_start so that in the split
2544 * case we'll continue with more data in the next round,
2545 * but break unconditionally so unsplit data stops here.
2546 */
2547 if (state->split)
2548 state->split_start++;
2549 else
2550 state->split_start = 0;
2551 break;
2552 case 9:
2553 if (nl80211_send_mgmt_stypes(msg, mgmt_stypes))
2554 goto nla_put_failure;
2555
2556 if (nla_put_u32(msg, NL80211_ATTR_MAX_NUM_SCHED_SCAN_PLANS,
2557 rdev->wiphy.max_sched_scan_plans) ||
2558 nla_put_u32(msg, NL80211_ATTR_MAX_SCAN_PLAN_INTERVAL,
2559 rdev->wiphy.max_sched_scan_plan_interval) ||
2560 nla_put_u32(msg, NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS,
2561 rdev->wiphy.max_sched_scan_plan_iterations))
2562 goto nla_put_failure;
2563
2564 if (rdev->wiphy.extended_capabilities &&
2565 (nla_put(msg, NL80211_ATTR_EXT_CAPA,
2566 rdev->wiphy.extended_capabilities_len,
2567 rdev->wiphy.extended_capabilities) ||
2568 nla_put(msg, NL80211_ATTR_EXT_CAPA_MASK,
2569 rdev->wiphy.extended_capabilities_len,
2570 rdev->wiphy.extended_capabilities_mask)))
2571 goto nla_put_failure;
2572
2573 if (rdev->wiphy.vht_capa_mod_mask &&
2574 nla_put(msg, NL80211_ATTR_VHT_CAPABILITY_MASK,
2575 sizeof(*rdev->wiphy.vht_capa_mod_mask),
2576 rdev->wiphy.vht_capa_mod_mask))
2577 goto nla_put_failure;
2578
2579 if (nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN,
2580 rdev->wiphy.perm_addr))
2581 goto nla_put_failure;
2582
2583 if (!is_zero_ether_addr(rdev->wiphy.addr_mask) &&
2584 nla_put(msg, NL80211_ATTR_MAC_MASK, ETH_ALEN,
2585 rdev->wiphy.addr_mask))
2586 goto nla_put_failure;
2587
2588 if (rdev->wiphy.n_addresses > 1) {
2589 void *attr;
2590
2591 attr = nla_nest_start(msg, NL80211_ATTR_MAC_ADDRS);
2592 if (!attr)
2593 goto nla_put_failure;
2594
2595 for (i = 0; i < rdev->wiphy.n_addresses; i++)
2596 if (nla_put(msg, i + 1, ETH_ALEN,
2597 rdev->wiphy.addresses[i].addr))
2598 goto nla_put_failure;
2599
2600 nla_nest_end(msg, attr);
2601 }
2602
2603 state->split_start++;
2604 break;
2605 case 10:
2606 if (nl80211_send_coalesce(msg, rdev))
2607 goto nla_put_failure;
2608
2609 if ((rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_5_10_MHZ) &&
2610 (nla_put_flag(msg, NL80211_ATTR_SUPPORT_5_MHZ) ||
2611 nla_put_flag(msg, NL80211_ATTR_SUPPORT_10_MHZ)))
2612 goto nla_put_failure;
2613
2614 if (rdev->wiphy.max_ap_assoc_sta &&
2615 nla_put_u32(msg, NL80211_ATTR_MAX_AP_ASSOC_STA,
2616 rdev->wiphy.max_ap_assoc_sta))
2617 goto nla_put_failure;
2618
2619 state->split_start++;
2620 break;
2621 case 11:
2622 if (rdev->wiphy.n_vendor_commands) {
2623 const struct nl80211_vendor_cmd_info *info;
2624 struct nlattr *nested;
2625
2626 nested = nla_nest_start_noflag(msg,
2627 NL80211_ATTR_VENDOR_DATA);
2628 if (!nested)
2629 goto nla_put_failure;
2630
2631 for (i = 0; i < rdev->wiphy.n_vendor_commands; i++) {
2632 info = &rdev->wiphy.vendor_commands[i].info;
2633 if (nla_put(msg, i + 1, sizeof(*info), info))
2634 goto nla_put_failure;
2635 }
2636 nla_nest_end(msg, nested);
2637 }
2638
2639 if (rdev->wiphy.n_vendor_events) {
2640 const struct nl80211_vendor_cmd_info *info;
2641 struct nlattr *nested;
2642
2643 nested = nla_nest_start_noflag(msg,
2644 NL80211_ATTR_VENDOR_EVENTS);
2645 if (!nested)
2646 goto nla_put_failure;
2647
2648 for (i = 0; i < rdev->wiphy.n_vendor_events; i++) {
2649 info = &rdev->wiphy.vendor_events[i];
2650 if (nla_put(msg, i + 1, sizeof(*info), info))
2651 goto nla_put_failure;
2652 }
2653 nla_nest_end(msg, nested);
2654 }
2655 state->split_start++;
2656 break;
2657 case 12:
2658 if (rdev->wiphy.flags & WIPHY_FLAG_HAS_CHANNEL_SWITCH &&
2659 nla_put_u8(msg, NL80211_ATTR_MAX_CSA_COUNTERS,
2660 rdev->wiphy.max_num_csa_counters))
2661 goto nla_put_failure;
2662
2663 if (rdev->wiphy.regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED &&
2664 nla_put_flag(msg, NL80211_ATTR_WIPHY_SELF_MANAGED_REG))
2665 goto nla_put_failure;
2666
2667 if (rdev->wiphy.max_sched_scan_reqs &&
2668 nla_put_u32(msg, NL80211_ATTR_SCHED_SCAN_MAX_REQS,
2669 rdev->wiphy.max_sched_scan_reqs))
2670 goto nla_put_failure;
2671
2672 if (nla_put(msg, NL80211_ATTR_EXT_FEATURES,
2673 sizeof(rdev->wiphy.ext_features),
2674 rdev->wiphy.ext_features))
2675 goto nla_put_failure;
2676
2677 if (rdev->wiphy.bss_select_support) {
2678 struct nlattr *nested;
2679 u32 bss_select_support = rdev->wiphy.bss_select_support;
2680
2681 nested = nla_nest_start_noflag(msg,
2682 NL80211_ATTR_BSS_SELECT);
2683 if (!nested)
2684 goto nla_put_failure;
2685
2686 i = 0;
2687 while (bss_select_support) {
2688 if ((bss_select_support & 1) &&
2689 nla_put_flag(msg, i))
2690 goto nla_put_failure;
2691 i++;
2692 bss_select_support >>= 1;
2693 }
2694 nla_nest_end(msg, nested);
2695 }
2696
2697 state->split_start++;
2698 break;
2699 case 13:
2700 if (rdev->wiphy.num_iftype_ext_capab &&
2701 rdev->wiphy.iftype_ext_capab) {
2702 struct nlattr *nested_ext_capab, *nested;
2703
2704 nested = nla_nest_start_noflag(msg,
2705 NL80211_ATTR_IFTYPE_EXT_CAPA);
2706 if (!nested)
2707 goto nla_put_failure;
2708
2709 for (i = state->capa_start;
2710 i < rdev->wiphy.num_iftype_ext_capab; i++) {
2711 const struct wiphy_iftype_ext_capab *capab;
2712
2713 capab = &rdev->wiphy.iftype_ext_capab[i];
2714
2715 nested_ext_capab = nla_nest_start_noflag(msg,
2716 i);
2717 if (!nested_ext_capab ||
2718 nla_put_u32(msg, NL80211_ATTR_IFTYPE,
2719 capab->iftype) ||
2720 nla_put(msg, NL80211_ATTR_EXT_CAPA,
2721 capab->extended_capabilities_len,
2722 capab->extended_capabilities) ||
2723 nla_put(msg, NL80211_ATTR_EXT_CAPA_MASK,
2724 capab->extended_capabilities_len,
2725 capab->extended_capabilities_mask))
2726 goto nla_put_failure;
2727
2728 nla_nest_end(msg, nested_ext_capab);
2729 if (state->split)
2730 break;
2731 }
2732 nla_nest_end(msg, nested);
2733 if (i < rdev->wiphy.num_iftype_ext_capab) {
2734 state->capa_start = i + 1;
2735 break;
2736 }
2737 }
2738
2739 if (nla_put_u32(msg, NL80211_ATTR_BANDS,
2740 rdev->wiphy.nan_supported_bands))
2741 goto nla_put_failure;
2742
2743 if (wiphy_ext_feature_isset(&rdev->wiphy,
2744 NL80211_EXT_FEATURE_TXQS)) {
2745 struct cfg80211_txq_stats txqstats = {};
2746 int res;
2747
2748 res = rdev_get_txq_stats(rdev, NULL, &txqstats);
2749 if (!res &&
2750 !nl80211_put_txq_stats(msg, &txqstats,
2751 NL80211_ATTR_TXQ_STATS))
2752 goto nla_put_failure;
2753
2754 if (nla_put_u32(msg, NL80211_ATTR_TXQ_LIMIT,
2755 rdev->wiphy.txq_limit))
2756 goto nla_put_failure;
2757 if (nla_put_u32(msg, NL80211_ATTR_TXQ_MEMORY_LIMIT,
2758 rdev->wiphy.txq_memory_limit))
2759 goto nla_put_failure;
2760 if (nla_put_u32(msg, NL80211_ATTR_TXQ_QUANTUM,
2761 rdev->wiphy.txq_quantum))
2762 goto nla_put_failure;
2763 }
2764
2765 state->split_start++;
2766 break;
2767 case 14:
2768 if (nl80211_send_pmsr_capa(rdev, msg))
2769 goto nla_put_failure;
2770
2771 state->split_start++;
2772 break;
2773 case 15:
2774 if (rdev->wiphy.akm_suites &&
2775 nla_put(msg, NL80211_ATTR_AKM_SUITES,
2776 sizeof(u32) * rdev->wiphy.n_akm_suites,
2777 rdev->wiphy.akm_suites))
2778 goto nla_put_failure;
2779
2780 if (nl80211_put_iftype_akm_suites(rdev, msg))
2781 goto nla_put_failure;
2782
2783 if (nl80211_put_tid_config_support(rdev, msg))
2784 goto nla_put_failure;
2785 state->split_start++;
2786 break;
2787 case 16:
2788 if (nl80211_put_sar_specs(rdev, msg))
2789 goto nla_put_failure;
2790
2791 /* done */
2792 state->split_start = 0;
2793 break;
2794 }
2795 finish:
2796 genlmsg_end(msg, hdr);
2797 return 0;
2798
2799 nla_put_failure:
2800 genlmsg_cancel(msg, hdr);
2801 return -EMSGSIZE;
2802 }
2803
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
Re: [PATCH v13 15/18] mm/memcg: Add folio_lruvec()
by kernel test robot
Hi "Matthew,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v5.14-rc1 next-20210712]
[cannot apply to hnaz-linux-mm/master tip/perf/core linux/master]
[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/Matthew-Wilcox-Oracle/Convert-me...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git e73f0f0ee7541171d89f2e2491130c7771ba58d3
config: i386-randconfig-p002-20210712 (attached as .config)
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/01c63778e430697015122448ac6344d1d...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Matthew-Wilcox-Oracle/Convert-memcg-to-folios/20210713-035650
git checkout 01c63778e430697015122448ac6344d1dc2f10e4
# save the attached .config to linux build tree
make W=1 ARCH=i386
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 >>):
| ^~~~~~~~~~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:420:55: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
420 | static inline struct obj_cgroup *__folio_objcg(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h: In function '__folio_objcg':
include/linux/memcontrol.h:422:34: error: dereferencing pointer to incomplete type 'struct folio'
422 | unsigned long memcg_data = folio->memcg_data;
| ^~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:451:53: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
451 | static inline struct mem_cgroup *folio_memcg(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h: In function 'folio_memcg':
include/linux/memcontrol.h:453:23: error: passing argument 1 of 'folio_memcg_kmem' from incompatible pointer type [-Werror=incompatible-pointer-types]
453 | if (folio_memcg_kmem(folio))
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:375:51: note: expected 'struct folio *' but argument is of type 'struct folio *'
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h:454:41: error: passing argument 1 of '__folio_objcg' from incompatible pointer type [-Werror=incompatible-pointer-types]
454 | return obj_cgroup_memcg(__folio_objcg(folio));
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:420:62: note: expected 'struct folio *' but argument is of type 'struct folio *'
420 | static inline struct obj_cgroup *__folio_objcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h:455:23: error: passing argument 1 of '__folio_memcg' from incompatible pointer type [-Werror=incompatible-pointer-types]
455 | return __folio_memcg(folio);
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:399:62: note: expected 'struct folio *' but argument is of type 'struct folio *'
399 | static inline struct mem_cgroup *__folio_memcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h: In function 'page_memcg':
include/linux/memcontrol.h:460:21: error: implicit declaration of function 'page_folio' [-Werror=implicit-function-declaration]
460 | return folio_memcg(page_folio(page));
| ^~~~~~~~~~
include/linux/memcontrol.h:460:21: warning: passing argument 1 of 'folio_memcg' makes pointer from integer without a cast [-Wint-conversion]
460 | return folio_memcg(page_folio(page));
| ^~~~~~~~~~~~~~~~
| |
| int
include/linux/memcontrol.h:451:60: note: expected 'struct folio *' but argument is of type 'int'
451 | static inline struct mem_cgroup *folio_memcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:540:44: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
540 | static inline bool folio_memcg_kmem(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h:540:20: error: conflicting types for 'folio_memcg_kmem'
540 | static inline bool folio_memcg_kmem(struct folio *folio)
| ^~~~~~~~~~~~~~~~
include/linux/memcontrol.h:375:20: note: previous declaration of 'folio_memcg_kmem' was here
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ^~~~~~~~~~~~~~~~
In file included from include/asm-generic/atomic-instrumented.h:20,
from include/linux/atomic.h:81,
from include/linux/crypto.h:15,
from arch/x86/kernel/asm-offsets.c:9:
include/linux/memcontrol.h: In function 'folio_memcg_kmem':
include/linux/memcontrol.h:542:35: error: dereferencing pointer to incomplete type 'struct folio'
542 | VM_BUG_ON_PGFLAGS(PageTail(&folio->page), &folio->page);
| ^~
include/linux/build_bug.h:30:63: note: in definition of macro 'BUILD_BUG_ON_INVALID'
30 | #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
| ^
include/linux/memcontrol.h:542:2: note: in expansion of macro 'VM_BUG_ON_PGFLAGS'
542 | VM_BUG_ON_PGFLAGS(PageTail(&folio->page), &folio->page);
| ^~~~~~~~~~~~~~~~~
In file included from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from arch/x86/kernel/asm-offsets.c:13:
include/linux/memcontrol.h: In function 'PageMemcgKmem':
include/linux/memcontrol.h:606:26: warning: passing argument 1 of 'folio_memcg_kmem' makes pointer from integer without a cast [-Wint-conversion]
606 | return folio_memcg_kmem(page_folio(page));
| ^~~~~~~~~~~~~~~~
| |
| int
include/linux/memcontrol.h:540:51: note: expected 'struct folio *' but argument is of type 'int'
540 | static inline bool folio_memcg_kmem(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:707:30: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
707 | int mem_cgroup_charge(struct folio *, struct mm_struct *, gfp_t);
| ^~~~~
include/linux/memcontrol.h:712:33: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
712 | void mem_cgroup_uncharge(struct folio *folio);
| ^~~~~
include/linux/memcontrol.h:715:32: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
715 | void mem_cgroup_migrate(struct folio *old, struct folio *new);
| ^~~~~
include/linux/memcontrol.h:759:50: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
759 | static inline struct lruvec *folio_lruvec(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h: In function 'folio_lruvec':
>> include/linux/memcontrol.h:761:41: error: passing argument 1 of 'folio_memcg' from incompatible pointer type [-Werror=incompatible-pointer-types]
761 | struct mem_cgroup *memcg = folio_memcg(folio);
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:451:60: note: expected 'struct folio *' but argument is of type 'struct folio *'
451 | static inline struct mem_cgroup *folio_memcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
>> include/linux/memcontrol.h:763:2: error: implicit declaration of function 'VM_WARN_ON_ONCE_FOLIO'; did you mean 'VM_WARN_ON_ONCE_PAGE'? [-Werror=implicit-function-declaration]
763 | VM_WARN_ON_ONCE_FOLIO(!memcg && !mem_cgroup_disabled(), folio);
| ^~~~~~~~~~~~~~~~~~~~~
| VM_WARN_ON_ONCE_PAGE
>> include/linux/memcontrol.h:764:34: error: implicit declaration of function 'folio_pgdat'; did you mean 'folio_nid'? [-Werror=implicit-function-declaration]
764 | return mem_cgroup_lruvec(memcg, folio_pgdat(folio));
| ^~~~~~~~~~~
| folio_nid
include/linux/memcontrol.h:764:34: warning: passing argument 2 of 'mem_cgroup_lruvec' makes pointer from integer without a cast [-Wint-conversion]
764 | return mem_cgroup_lruvec(memcg, folio_pgdat(folio));
| ^~~~~~~~~~~~~~~~~~
| |
| int
include/linux/memcontrol.h:727:33: note: expected 'struct pglist_data *' but argument is of type 'int'
727 | struct pglist_data *pgdat)
| ~~~~~~~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:952:30: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
952 | void folio_memcg_lock(struct folio *folio);
| ^~~~~
include/linux/memcontrol.h:953:32: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
953 | void folio_memcg_unlock(struct folio *folio);
| ^~~~~
include/linux/memcontrol.h:375:20: warning: 'folio_memcg_kmem' used but never defined
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ^~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
--
| ^~~~~~~~~~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:420:55: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
420 | static inline struct obj_cgroup *__folio_objcg(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h: In function '__folio_objcg':
include/linux/memcontrol.h:422:34: error: dereferencing pointer to incomplete type 'struct folio'
422 | unsigned long memcg_data = folio->memcg_data;
| ^~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:451:53: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
451 | static inline struct mem_cgroup *folio_memcg(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h: In function 'folio_memcg':
include/linux/memcontrol.h:453:23: error: passing argument 1 of 'folio_memcg_kmem' from incompatible pointer type [-Werror=incompatible-pointer-types]
453 | if (folio_memcg_kmem(folio))
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:375:51: note: expected 'struct folio *' but argument is of type 'struct folio *'
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h:454:41: error: passing argument 1 of '__folio_objcg' from incompatible pointer type [-Werror=incompatible-pointer-types]
454 | return obj_cgroup_memcg(__folio_objcg(folio));
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:420:62: note: expected 'struct folio *' but argument is of type 'struct folio *'
420 | static inline struct obj_cgroup *__folio_objcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h:455:23: error: passing argument 1 of '__folio_memcg' from incompatible pointer type [-Werror=incompatible-pointer-types]
455 | return __folio_memcg(folio);
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:399:62: note: expected 'struct folio *' but argument is of type 'struct folio *'
399 | static inline struct mem_cgroup *__folio_memcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h: In function 'page_memcg':
include/linux/memcontrol.h:460:21: error: implicit declaration of function 'page_folio' [-Werror=implicit-function-declaration]
460 | return folio_memcg(page_folio(page));
| ^~~~~~~~~~
include/linux/memcontrol.h:460:21: warning: passing argument 1 of 'folio_memcg' makes pointer from integer without a cast [-Wint-conversion]
460 | return folio_memcg(page_folio(page));
| ^~~~~~~~~~~~~~~~
| |
| int
include/linux/memcontrol.h:451:60: note: expected 'struct folio *' but argument is of type 'int'
451 | static inline struct mem_cgroup *folio_memcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:540:44: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
540 | static inline bool folio_memcg_kmem(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h:540:20: error: conflicting types for 'folio_memcg_kmem'
540 | static inline bool folio_memcg_kmem(struct folio *folio)
| ^~~~~~~~~~~~~~~~
include/linux/memcontrol.h:375:20: note: previous declaration of 'folio_memcg_kmem' was here
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ^~~~~~~~~~~~~~~~
In file included from include/asm-generic/atomic-instrumented.h:20,
from include/linux/atomic.h:81,
from include/linux/crypto.h:15,
from arch/x86/kernel/asm-offsets.c:9:
include/linux/memcontrol.h: In function 'folio_memcg_kmem':
include/linux/memcontrol.h:542:35: error: dereferencing pointer to incomplete type 'struct folio'
542 | VM_BUG_ON_PGFLAGS(PageTail(&folio->page), &folio->page);
| ^~
include/linux/build_bug.h:30:63: note: in definition of macro 'BUILD_BUG_ON_INVALID'
30 | #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
| ^
include/linux/memcontrol.h:542:2: note: in expansion of macro 'VM_BUG_ON_PGFLAGS'
542 | VM_BUG_ON_PGFLAGS(PageTail(&folio->page), &folio->page);
| ^~~~~~~~~~~~~~~~~
In file included from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from arch/x86/kernel/asm-offsets.c:13:
include/linux/memcontrol.h: In function 'PageMemcgKmem':
include/linux/memcontrol.h:606:26: warning: passing argument 1 of 'folio_memcg_kmem' makes pointer from integer without a cast [-Wint-conversion]
606 | return folio_memcg_kmem(page_folio(page));
| ^~~~~~~~~~~~~~~~
| |
| int
include/linux/memcontrol.h:540:51: note: expected 'struct folio *' but argument is of type 'int'
540 | static inline bool folio_memcg_kmem(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:707:30: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
707 | int mem_cgroup_charge(struct folio *, struct mm_struct *, gfp_t);
| ^~~~~
include/linux/memcontrol.h:712:33: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
712 | void mem_cgroup_uncharge(struct folio *folio);
| ^~~~~
include/linux/memcontrol.h:715:32: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
715 | void mem_cgroup_migrate(struct folio *old, struct folio *new);
| ^~~~~
include/linux/memcontrol.h:759:50: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
759 | static inline struct lruvec *folio_lruvec(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h: In function 'folio_lruvec':
>> include/linux/memcontrol.h:761:41: error: passing argument 1 of 'folio_memcg' from incompatible pointer type [-Werror=incompatible-pointer-types]
761 | struct mem_cgroup *memcg = folio_memcg(folio);
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:451:60: note: expected 'struct folio *' but argument is of type 'struct folio *'
451 | static inline struct mem_cgroup *folio_memcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
>> include/linux/memcontrol.h:763:2: error: implicit declaration of function 'VM_WARN_ON_ONCE_FOLIO'; did you mean 'VM_WARN_ON_ONCE_PAGE'? [-Werror=implicit-function-declaration]
763 | VM_WARN_ON_ONCE_FOLIO(!memcg && !mem_cgroup_disabled(), folio);
| ^~~~~~~~~~~~~~~~~~~~~
| VM_WARN_ON_ONCE_PAGE
>> include/linux/memcontrol.h:764:34: error: implicit declaration of function 'folio_pgdat'; did you mean 'folio_nid'? [-Werror=implicit-function-declaration]
764 | return mem_cgroup_lruvec(memcg, folio_pgdat(folio));
| ^~~~~~~~~~~
| folio_nid
include/linux/memcontrol.h:764:34: warning: passing argument 2 of 'mem_cgroup_lruvec' makes pointer from integer without a cast [-Wint-conversion]
764 | return mem_cgroup_lruvec(memcg, folio_pgdat(folio));
| ^~~~~~~~~~~~~~~~~~
| |
| int
include/linux/memcontrol.h:727:33: note: expected 'struct pglist_data *' but argument is of type 'int'
727 | struct pglist_data *pgdat)
| ~~~~~~~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:952:30: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
952 | void folio_memcg_lock(struct folio *folio);
| ^~~~~
include/linux/memcontrol.h:953:32: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
953 | void folio_memcg_unlock(struct folio *folio);
| ^~~~~
include/linux/memcontrol.h:375:20: warning: 'folio_memcg_kmem' used but never defined
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ^~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:117: arch/x86/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1212: prepare0] Error 2
make[1]: Target 'modules_prepare' not remade because of errors.
make: *** [Makefile:220: __sub-make] Error 2
make: Target 'modules_prepare' not remade because of errors.
--
| ^~~~~~~~~~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:420:55: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
420 | static inline struct obj_cgroup *__folio_objcg(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h: In function '__folio_objcg':
include/linux/memcontrol.h:422:34: error: dereferencing pointer to incomplete type 'struct folio'
422 | unsigned long memcg_data = folio->memcg_data;
| ^~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:451:53: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
451 | static inline struct mem_cgroup *folio_memcg(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h: In function 'folio_memcg':
include/linux/memcontrol.h:453:23: error: passing argument 1 of 'folio_memcg_kmem' from incompatible pointer type [-Werror=incompatible-pointer-types]
453 | if (folio_memcg_kmem(folio))
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:375:51: note: expected 'struct folio *' but argument is of type 'struct folio *'
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h:454:41: error: passing argument 1 of '__folio_objcg' from incompatible pointer type [-Werror=incompatible-pointer-types]
454 | return obj_cgroup_memcg(__folio_objcg(folio));
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:420:62: note: expected 'struct folio *' but argument is of type 'struct folio *'
420 | static inline struct obj_cgroup *__folio_objcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h:455:23: error: passing argument 1 of '__folio_memcg' from incompatible pointer type [-Werror=incompatible-pointer-types]
455 | return __folio_memcg(folio);
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:399:62: note: expected 'struct folio *' but argument is of type 'struct folio *'
399 | static inline struct mem_cgroup *__folio_memcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h: In function 'page_memcg':
include/linux/memcontrol.h:460:21: error: implicit declaration of function 'page_folio' [-Werror=implicit-function-declaration]
460 | return folio_memcg(page_folio(page));
| ^~~~~~~~~~
include/linux/memcontrol.h:460:21: warning: passing argument 1 of 'folio_memcg' makes pointer from integer without a cast [-Wint-conversion]
460 | return folio_memcg(page_folio(page));
| ^~~~~~~~~~~~~~~~
| |
| int
include/linux/memcontrol.h:451:60: note: expected 'struct folio *' but argument is of type 'int'
451 | static inline struct mem_cgroup *folio_memcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:540:44: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
540 | static inline bool folio_memcg_kmem(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h:540:20: error: conflicting types for 'folio_memcg_kmem'
540 | static inline bool folio_memcg_kmem(struct folio *folio)
| ^~~~~~~~~~~~~~~~
include/linux/memcontrol.h:375:20: note: previous declaration of 'folio_memcg_kmem' was here
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ^~~~~~~~~~~~~~~~
In file included from include/asm-generic/atomic-instrumented.h:20,
from include/linux/atomic.h:81,
from include/linux/crypto.h:15,
from arch/x86/kernel/asm-offsets.c:9:
include/linux/memcontrol.h: In function 'folio_memcg_kmem':
include/linux/memcontrol.h:542:35: error: dereferencing pointer to incomplete type 'struct folio'
542 | VM_BUG_ON_PGFLAGS(PageTail(&folio->page), &folio->page);
| ^~
include/linux/build_bug.h:30:63: note: in definition of macro 'BUILD_BUG_ON_INVALID'
30 | #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
| ^
include/linux/memcontrol.h:542:2: note: in expansion of macro 'VM_BUG_ON_PGFLAGS'
542 | VM_BUG_ON_PGFLAGS(PageTail(&folio->page), &folio->page);
| ^~~~~~~~~~~~~~~~~
In file included from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from arch/x86/kernel/asm-offsets.c:13:
include/linux/memcontrol.h: In function 'PageMemcgKmem':
include/linux/memcontrol.h:606:26: warning: passing argument 1 of 'folio_memcg_kmem' makes pointer from integer without a cast [-Wint-conversion]
606 | return folio_memcg_kmem(page_folio(page));
| ^~~~~~~~~~~~~~~~
| |
| int
include/linux/memcontrol.h:540:51: note: expected 'struct folio *' but argument is of type 'int'
540 | static inline bool folio_memcg_kmem(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:707:30: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
707 | int mem_cgroup_charge(struct folio *, struct mm_struct *, gfp_t);
| ^~~~~
include/linux/memcontrol.h:712:33: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
712 | void mem_cgroup_uncharge(struct folio *folio);
| ^~~~~
include/linux/memcontrol.h:715:32: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
715 | void mem_cgroup_migrate(struct folio *old, struct folio *new);
| ^~~~~
include/linux/memcontrol.h:759:50: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
759 | static inline struct lruvec *folio_lruvec(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h: In function 'folio_lruvec':
>> include/linux/memcontrol.h:761:41: error: passing argument 1 of 'folio_memcg' from incompatible pointer type [-Werror=incompatible-pointer-types]
761 | struct mem_cgroup *memcg = folio_memcg(folio);
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:451:60: note: expected 'struct folio *' but argument is of type 'struct folio *'
451 | static inline struct mem_cgroup *folio_memcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
>> include/linux/memcontrol.h:763:2: error: implicit declaration of function 'VM_WARN_ON_ONCE_FOLIO'; did you mean 'VM_WARN_ON_ONCE_PAGE'? [-Werror=implicit-function-declaration]
763 | VM_WARN_ON_ONCE_FOLIO(!memcg && !mem_cgroup_disabled(), folio);
| ^~~~~~~~~~~~~~~~~~~~~
| VM_WARN_ON_ONCE_PAGE
>> include/linux/memcontrol.h:764:34: error: implicit declaration of function 'folio_pgdat'; did you mean 'folio_nid'? [-Werror=implicit-function-declaration]
764 | return mem_cgroup_lruvec(memcg, folio_pgdat(folio));
| ^~~~~~~~~~~
| folio_nid
include/linux/memcontrol.h:764:34: warning: passing argument 2 of 'mem_cgroup_lruvec' makes pointer from integer without a cast [-Wint-conversion]
764 | return mem_cgroup_lruvec(memcg, folio_pgdat(folio));
| ^~~~~~~~~~~~~~~~~~
| |
| int
include/linux/memcontrol.h:727:33: note: expected 'struct pglist_data *' but argument is of type 'int'
727 | struct pglist_data *pgdat)
| ~~~~~~~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:952:30: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
952 | void folio_memcg_lock(struct folio *folio);
| ^~~~~
include/linux/memcontrol.h:953:32: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
953 | void folio_memcg_unlock(struct folio *folio);
| ^~~~~
include/linux/memcontrol.h:375:20: warning: 'folio_memcg_kmem' used but never defined
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ^~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:117: arch/x86/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1212: prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:220: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.
vim +/folio_memcg +761 include/linux/memcontrol.h
752
753 /**
754 * folio_lruvec - return lruvec for isolating/putting an LRU folio
755 * @folio: Pointer to the folio.
756 *
757 * This function relies on folio->mem_cgroup being stable.
758 */
759 static inline struct lruvec *folio_lruvec(struct folio *folio)
760 {
> 761 struct mem_cgroup *memcg = folio_memcg(folio);
762
> 763 VM_WARN_ON_ONCE_FOLIO(!memcg && !mem_cgroup_disabled(), folio);
> 764 return mem_cgroup_lruvec(memcg, folio_pgdat(folio));
765 }
766
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
[intel-tdx:guest 36/83] include/linux/compiler_types.h:328:38: error: call to '__compiletime_assert_223' declared with attribute error: Need native word sized stores/loads for atomicity.
by kernel test robot
tree: https://github.com/intel/tdx.git guest
head: 6694b109aa9d027bf75cf4e9742823accaf4c859
commit: 7d7b4481faca936d62f9a9594e5fc8e7d75678dd [36/83] x86/acpi, x86/boot: Add multiprocessor wake-up support
config: i386-randconfig-a004-20210712 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/intel/tdx/commit/7d7b4481faca936d62f9a9594e5fc8e7d75678dd
git remote add intel-tdx https://github.com/intel/tdx.git
git fetch --no-tags intel-tdx guest
git checkout 7d7b4481faca936d62f9a9594e5fc8e7d75678dd
# save the attached .config to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=i386 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 >>):
In file included from <command-line>:
arch/x86/kernel/acpi/boot.c: In function 'acpi_wakeup_cpu':
>> include/linux/compiler_types.h:328:38: error: call to '__compiletime_assert_223' declared with attribute error: Need native word sized stores/loads for atomicity.
328 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^
include/linux/compiler_types.h:309:4: note: in definition of macro '__compiletime_assert'
309 | prefix ## suffix(); \
| ^~~~~~
include/linux/compiler_types.h:328:2: note: in expansion of macro '_compiletime_assert'
328 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:331:2: note: in expansion of macro 'compiletime_assert'
331 | compiletime_assert(__native_word(t), \
| ^~~~~~~~~~~~~~~~~~
arch/x86/include/asm/barrier.h:68:2: note: in expansion of macro 'compiletime_assert_atomic_type'
68 | compiletime_assert_atomic_type(*p); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/barrier.h:138:33: note: in expansion of macro '__smp_store_release'
138 | #define smp_store_release(p, v) __smp_store_release(p, v)
| ^~~~~~~~~~~~~~~~~~~
arch/x86/kernel/acpi/boot.c:368:2: note: in expansion of macro 'smp_store_release'
368 | smp_store_release(&acpi_mp_wake_mailbox->wakeup_vector, start_ip);
| ^~~~~~~~~~~~~~~~~
vim +/__compiletime_assert_223 +328 include/linux/compiler_types.h
eb5c2d4b45e3d2 Will Deacon 2020-07-21 314
eb5c2d4b45e3d2 Will Deacon 2020-07-21 315 #define _compiletime_assert(condition, msg, prefix, suffix) \
eb5c2d4b45e3d2 Will Deacon 2020-07-21 316 __compiletime_assert(condition, msg, prefix, suffix)
eb5c2d4b45e3d2 Will Deacon 2020-07-21 317
eb5c2d4b45e3d2 Will Deacon 2020-07-21 318 /**
eb5c2d4b45e3d2 Will Deacon 2020-07-21 319 * compiletime_assert - break build and emit msg if condition is false
eb5c2d4b45e3d2 Will Deacon 2020-07-21 320 * @condition: a compile-time constant condition to check
eb5c2d4b45e3d2 Will Deacon 2020-07-21 321 * @msg: a message to emit if condition is false
eb5c2d4b45e3d2 Will Deacon 2020-07-21 322 *
eb5c2d4b45e3d2 Will Deacon 2020-07-21 323 * In tradition of POSIX assert, this macro will break the build if the
eb5c2d4b45e3d2 Will Deacon 2020-07-21 324 * supplied condition is *false*, emitting the supplied error message if the
eb5c2d4b45e3d2 Will Deacon 2020-07-21 325 * compiler has support to do so.
eb5c2d4b45e3d2 Will Deacon 2020-07-21 326 */
eb5c2d4b45e3d2 Will Deacon 2020-07-21 327 #define compiletime_assert(condition, msg) \
eb5c2d4b45e3d2 Will Deacon 2020-07-21 @328 _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
eb5c2d4b45e3d2 Will Deacon 2020-07-21 329
:::::: The code at line 328 was first introduced by commit
:::::: eb5c2d4b45e3d2d5d052ea6b8f1463976b1020d5 compiler.h: Move compiletime_assert() macros into compiler_types.h
:::::: TO: Will Deacon <will(a)kernel.org>
:::::: CC: Will Deacon <will(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
Re: [PATCH v13 08/18] mm/memcg: Convert mem_cgroup_charge() to take a folio
by kernel test robot
Hi "Matthew,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v5.14-rc1 next-20210712]
[cannot apply to hnaz-linux-mm/master tip/perf/core linux/master]
[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/Matthew-Wilcox-Oracle/Convert-me...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git e73f0f0ee7541171d89f2e2491130c7771ba58d3
config: nds32-allnoconfig (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/3aa23c53058c0abac2b7fd5d8c80f9b45...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Matthew-Wilcox-Oracle/Convert-memcg-to-folios/20210713-035650
git checkout 3aa23c53058c0abac2b7fd5d8c80f9b458a2665f
# 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 errors (new ones prefixed by >>):
In file included from include/linux/dax.h:6,
from mm/filemap.c:15:
include/linux/mm.h:1380:42: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
1380 | static inline int folio_nid(const struct folio *folio)
| ^~~~~
include/linux/mm.h: In function 'folio_nid':
include/linux/mm.h:1382:27: error: dereferencing pointer to incomplete type 'const struct folio'
1382 | return page_to_nid(&folio->page);
| ^~
In file included from include/linux/swap.h:9,
from mm/filemap.c:23:
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:1120:53: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
1120 | static inline struct mem_cgroup *folio_memcg(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h:1141:44: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
1141 | static inline bool folio_memcg_kmem(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h:1193:44: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
1193 | static inline int mem_cgroup_charge(struct folio *folio,
| ^~~~~
mm/filemap.c: In function '__add_to_page_cache_locked':
>> mm/filemap.c:875:29: error: implicit declaration of function 'page_folio'; did you mean 'page_endio'? [-Werror=implicit-function-declaration]
875 | error = mem_cgroup_charge(page_folio(page), NULL, gfp);
| ^~~~~~~~~~
| page_endio
mm/filemap.c:875:29: warning: passing argument 1 of 'mem_cgroup_charge' makes pointer from integer without a cast [-Wint-conversion]
875 | error = mem_cgroup_charge(page_folio(page), NULL, gfp);
| ^~~~~~~~~~~~~~~~
| |
| int
In file included from include/linux/swap.h:9,
from mm/filemap.c:23:
include/linux/memcontrol.h:1193:51: note: expected 'struct folio *' but argument is of type 'int'
1193 | static inline int mem_cgroup_charge(struct folio *folio,
| ~~~~~~~~~~~~~~^~~~~
cc1: some warnings being treated as errors
--
In file included from include/linux/security.h:33,
from include/linux/fs_context.h:14,
from include/linux/fs_parser.h:11,
from include/linux/ramfs.h:5,
from mm/shmem.c:28:
include/linux/mm.h:1380:42: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
1380 | static inline int folio_nid(const struct folio *folio)
| ^~~~~
include/linux/mm.h: In function 'folio_nid':
include/linux/mm.h:1382:27: error: dereferencing pointer to incomplete type 'const struct folio'
1382 | return page_to_nid(&folio->page);
| ^~
In file included from include/linux/swap.h:9,
from mm/shmem.c:35:
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:1120:53: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
1120 | static inline struct mem_cgroup *folio_memcg(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h:1141:44: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
1141 | static inline bool folio_memcg_kmem(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h:1193:44: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
1193 | static inline int mem_cgroup_charge(struct folio *folio,
| ^~~~~
mm/shmem.c: In function 'shmem_add_to_page_cache':
>> mm/shmem.c:688:29: error: implicit declaration of function 'page_folio'; did you mean 'page_endio'? [-Werror=implicit-function-declaration]
688 | error = mem_cgroup_charge(page_folio(page), charge_mm, gfp);
| ^~~~~~~~~~
| page_endio
mm/shmem.c:688:29: warning: passing argument 1 of 'mem_cgroup_charge' makes pointer from integer without a cast [-Wint-conversion]
688 | error = mem_cgroup_charge(page_folio(page), charge_mm, gfp);
| ^~~~~~~~~~~~~~~~
| |
| int
In file included from include/linux/swap.h:9,
from mm/shmem.c:35:
include/linux/memcontrol.h:1193:51: note: expected 'struct folio *' but argument is of type 'int'
1193 | static inline int mem_cgroup_charge(struct folio *folio,
| ~~~~~~~~~~~~~~^~~~~
cc1: some warnings being treated as errors
--
In file included from mm/memory.c:43:
include/linux/mm.h:1380:42: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
1380 | static inline int folio_nid(const struct folio *folio)
| ^~~~~
include/linux/mm.h: In function 'folio_nid':
include/linux/mm.h:1382:27: error: dereferencing pointer to incomplete type 'const struct folio'
1382 | return page_to_nid(&folio->page);
| ^~
In file included from include/linux/swap.h:9,
from mm/memory.c:50:
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:1120:53: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
1120 | static inline struct mem_cgroup *folio_memcg(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h:1141:44: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
1141 | static inline bool folio_memcg_kmem(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h:1193:44: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
1193 | static inline int mem_cgroup_charge(struct folio *folio,
| ^~~~~
mm/memory.c: In function 'page_copy_prealloc':
>> mm/memory.c:993:24: error: implicit declaration of function 'page_folio'; did you mean 'page_endio'? [-Werror=implicit-function-declaration]
993 | if (mem_cgroup_charge(page_folio(new_page), src_mm, GFP_KERNEL)) {
| ^~~~~~~~~~
| page_endio
mm/memory.c:993:24: warning: passing argument 1 of 'mem_cgroup_charge' makes pointer from integer without a cast [-Wint-conversion]
993 | if (mem_cgroup_charge(page_folio(new_page), src_mm, GFP_KERNEL)) {
| ^~~~~~~~~~~~~~~~~~~~
| |
| int
In file included from include/linux/swap.h:9,
from mm/memory.c:50:
include/linux/memcontrol.h:1193:51: note: expected 'struct folio *' but argument is of type 'int'
1193 | static inline int mem_cgroup_charge(struct folio *folio,
| ~~~~~~~~~~~~~~^~~~~
mm/memory.c: In function 'wp_page_copy':
mm/memory.c:3022:24: warning: passing argument 1 of 'mem_cgroup_charge' makes pointer from integer without a cast [-Wint-conversion]
3022 | if (mem_cgroup_charge(page_folio(new_page), mm, GFP_KERNEL))
| ^~~~~~~~~~~~~~~~~~~~
| |
| int
In file included from include/linux/swap.h:9,
from mm/memory.c:50:
include/linux/memcontrol.h:1193:51: note: expected 'struct folio *' but argument is of type 'int'
1193 | static inline int mem_cgroup_charge(struct folio *folio,
| ~~~~~~~~~~~~~~^~~~~
mm/memory.c: In function 'do_anonymous_page':
mm/memory.c:3771:24: warning: passing argument 1 of 'mem_cgroup_charge' makes pointer from integer without a cast [-Wint-conversion]
3771 | if (mem_cgroup_charge(page_folio(page), vma->vm_mm, GFP_KERNEL))
| ^~~~~~~~~~~~~~~~
| |
| int
In file included from include/linux/swap.h:9,
from mm/memory.c:50:
include/linux/memcontrol.h:1193:51: note: expected 'struct folio *' but argument is of type 'int'
1193 | static inline int mem_cgroup_charge(struct folio *folio,
| ~~~~~~~~~~~~~~^~~~~
mm/memory.c: In function 'do_cow_fault':
mm/memory.c:4186:24: warning: passing argument 1 of 'mem_cgroup_charge' makes pointer from integer without a cast [-Wint-conversion]
4186 | if (mem_cgroup_charge(page_folio(vmf->cow_page), vma->vm_mm,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
| |
| int
In file included from include/linux/swap.h:9,
from mm/memory.c:50:
include/linux/memcontrol.h:1193:51: note: expected 'struct folio *' but argument is of type 'int'
1193 | static inline int mem_cgroup_charge(struct folio *folio,
| ~~~~~~~~~~~~~~^~~~~
cc1: some warnings being treated as errors
vim +875 mm/filemap.c
855
856 noinline int __add_to_page_cache_locked(struct page *page,
857 struct address_space *mapping,
858 pgoff_t offset, gfp_t gfp,
859 void **shadowp)
860 {
861 XA_STATE(xas, &mapping->i_pages, offset);
862 int huge = PageHuge(page);
863 int error;
864 bool charged = false;
865
866 VM_BUG_ON_PAGE(!PageLocked(page), page);
867 VM_BUG_ON_PAGE(PageSwapBacked(page), page);
868 mapping_set_update(&xas, mapping);
869
870 get_page(page);
871 page->mapping = mapping;
872 page->index = offset;
873
874 if (!huge) {
> 875 error = mem_cgroup_charge(page_folio(page), NULL, gfp);
876 if (error)
877 goto error;
878 charged = true;
879 }
880
881 gfp &= GFP_RECLAIM_MASK;
882
883 do {
884 unsigned int order = xa_get_order(xas.xa, xas.xa_index);
885 void *entry, *old = NULL;
886
887 if (order > thp_order(page))
888 xas_split_alloc(&xas, xa_load(xas.xa, xas.xa_index),
889 order, gfp);
890 xas_lock_irq(&xas);
891 xas_for_each_conflict(&xas, entry) {
892 old = entry;
893 if (!xa_is_value(entry)) {
894 xas_set_err(&xas, -EEXIST);
895 goto unlock;
896 }
897 }
898
899 if (old) {
900 if (shadowp)
901 *shadowp = old;
902 /* entry may have been split before we acquired lock */
903 order = xa_get_order(xas.xa, xas.xa_index);
904 if (order > thp_order(page)) {
905 xas_split(&xas, old, order);
906 xas_reset(&xas);
907 }
908 }
909
910 xas_store(&xas, page);
911 if (xas_error(&xas))
912 goto unlock;
913
914 mapping->nrpages++;
915
916 /* hugetlb pages do not participate in page cache accounting */
917 if (!huge)
918 __inc_lruvec_page_state(page, NR_FILE_PAGES);
919 unlock:
920 xas_unlock_irq(&xas);
921 } while (xas_nomem(&xas, gfp));
922
923 if (xas_error(&xas)) {
924 error = xas_error(&xas);
925 if (charged)
926 mem_cgroup_uncharge(page);
927 goto error;
928 }
929
930 trace_mm_filemap_add_to_page_cache(page);
931 return 0;
932 error:
933 page->mapping = NULL;
934 /* Leave page->index set: truncation relies upon it */
935 put_page(page);
936 return error;
937 }
938 ALLOW_ERROR_INJECTION(__add_to_page_cache_locked, ERRNO);
939
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
Re: [PATCH v13 06/18] mm/memcg: Add folio_memcg() and related functions
by kernel test robot
Hi "Matthew,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v5.14-rc1 next-20210712]
[cannot apply to hnaz-linux-mm/master tip/perf/core linux/master]
[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/Matthew-Wilcox-Oracle/Convert-me...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git e73f0f0ee7541171d89f2e2491130c7771ba58d3
config: i386-randconfig-p002-20210712 (attached as .config)
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/90cfa1fbae827b338bee737e073ffab84...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Matthew-Wilcox-Oracle/Convert-memcg-to-folios/20210713-035650
git checkout 90cfa1fbae827b338bee737e073ffab84823bfed
# save the attached .config to linux build tree
make W=1 ARCH=i386
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 include/linux/kallsyms.h:13,
from include/linux/bpf.h:20,
from include/linux/bpf-cgroup.h:5,
from include/linux/cgroup-defs.h:22,
from include/linux/cgroup.h:28,
from include/linux/memcontrol.h:13,
from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from arch/x86/kernel/asm-offsets.c:13:
include/linux/mm.h:1380:42: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
1380 | static inline int folio_nid(const struct folio *folio)
| ^~~~~
include/linux/mm.h: In function 'folio_nid':
>> include/linux/mm.h:1382:27: error: dereferencing pointer to incomplete type 'const struct folio'
1382 | return page_to_nid(&folio->page);
| ^~
In file included from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from arch/x86/kernel/asm-offsets.c:13:
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:375:44: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ^~~~~
include/linux/memcontrol.h:399:55: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
399 | static inline struct mem_cgroup *__folio_memcg(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h: In function '__folio_memcg':
include/linux/memcontrol.h:401:34: error: dereferencing pointer to incomplete type 'struct folio'
401 | unsigned long memcg_data = folio->memcg_data;
| ^~
>> include/linux/memcontrol.h:403:2: error: implicit declaration of function 'VM_BUG_ON_FOLIO'; did you mean 'VM_BUG_ON_MM'? [-Werror=implicit-function-declaration]
403 | VM_BUG_ON_FOLIO(folio_slab(folio), folio);
| ^~~~~~~~~~~~~~~
| VM_BUG_ON_MM
>> include/linux/memcontrol.h:403:18: error: implicit declaration of function 'folio_slab' [-Werror=implicit-function-declaration]
403 | VM_BUG_ON_FOLIO(folio_slab(folio), folio);
| ^~~~~~~~~~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:420:55: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
420 | static inline struct obj_cgroup *__folio_objcg(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h: In function '__folio_objcg':
include/linux/memcontrol.h:422:34: error: dereferencing pointer to incomplete type 'struct folio'
422 | unsigned long memcg_data = folio->memcg_data;
| ^~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:451:53: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
451 | static inline struct mem_cgroup *folio_memcg(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h: In function 'folio_memcg':
>> include/linux/memcontrol.h:453:23: error: passing argument 1 of 'folio_memcg_kmem' from incompatible pointer type [-Werror=incompatible-pointer-types]
453 | if (folio_memcg_kmem(folio))
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:375:51: note: expected 'struct folio *' but argument is of type 'struct folio *'
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ~~~~~~~~~~~~~~^~~~~
>> include/linux/memcontrol.h:454:41: error: passing argument 1 of '__folio_objcg' from incompatible pointer type [-Werror=incompatible-pointer-types]
454 | return obj_cgroup_memcg(__folio_objcg(folio));
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:420:62: note: expected 'struct folio *' but argument is of type 'struct folio *'
420 | static inline struct obj_cgroup *__folio_objcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
>> include/linux/memcontrol.h:455:23: error: passing argument 1 of '__folio_memcg' from incompatible pointer type [-Werror=incompatible-pointer-types]
455 | return __folio_memcg(folio);
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:399:62: note: expected 'struct folio *' but argument is of type 'struct folio *'
399 | static inline struct mem_cgroup *__folio_memcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h: In function 'page_memcg':
>> include/linux/memcontrol.h:460:21: error: implicit declaration of function 'page_folio' [-Werror=implicit-function-declaration]
460 | return folio_memcg(page_folio(page));
| ^~~~~~~~~~
include/linux/memcontrol.h:460:21: warning: passing argument 1 of 'folio_memcg' makes pointer from integer without a cast [-Wint-conversion]
460 | return folio_memcg(page_folio(page));
| ^~~~~~~~~~~~~~~~
| |
| int
include/linux/memcontrol.h:451:60: note: expected 'struct folio *' but argument is of type 'int'
451 | static inline struct mem_cgroup *folio_memcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:540:44: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
540 | static inline bool folio_memcg_kmem(struct folio *folio)
| ^~~~~
>> include/linux/memcontrol.h:540:20: error: conflicting types for 'folio_memcg_kmem'
540 | static inline bool folio_memcg_kmem(struct folio *folio)
| ^~~~~~~~~~~~~~~~
include/linux/memcontrol.h:375:20: note: previous declaration of 'folio_memcg_kmem' was here
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ^~~~~~~~~~~~~~~~
In file included from include/asm-generic/atomic-instrumented.h:20,
from include/linux/atomic.h:81,
from include/linux/crypto.h:15,
from arch/x86/kernel/asm-offsets.c:9:
include/linux/memcontrol.h: In function 'folio_memcg_kmem':
include/linux/memcontrol.h:542:35: error: dereferencing pointer to incomplete type 'struct folio'
542 | VM_BUG_ON_PGFLAGS(PageTail(&folio->page), &folio->page);
| ^~
include/linux/build_bug.h:30:63: note: in definition of macro 'BUILD_BUG_ON_INVALID'
30 | #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
| ^
include/linux/memcontrol.h:542:2: note: in expansion of macro 'VM_BUG_ON_PGFLAGS'
542 | VM_BUG_ON_PGFLAGS(PageTail(&folio->page), &folio->page);
| ^~~~~~~~~~~~~~~~~
In file included from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from arch/x86/kernel/asm-offsets.c:13:
include/linux/memcontrol.h: In function 'PageMemcgKmem':
include/linux/memcontrol.h:606:26: warning: passing argument 1 of 'folio_memcg_kmem' makes pointer from integer without a cast [-Wint-conversion]
606 | return folio_memcg_kmem(page_folio(page));
| ^~~~~~~~~~~~~~~~
| |
| int
include/linux/memcontrol.h:540:51: note: expected 'struct folio *' but argument is of type 'int'
540 | static inline bool folio_memcg_kmem(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
arch/x86/kernel/asm-offsets.c: At top level:
include/linux/memcontrol.h:375:20: warning: 'folio_memcg_kmem' used but never defined
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ^~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
--
In file included from include/linux/kallsyms.h:13,
from include/linux/bpf.h:20,
from include/linux/bpf-cgroup.h:5,
from include/linux/cgroup-defs.h:22,
from include/linux/cgroup.h:28,
from include/linux/memcontrol.h:13,
from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from arch/x86/kernel/asm-offsets.c:13:
include/linux/mm.h:1380:42: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
1380 | static inline int folio_nid(const struct folio *folio)
| ^~~~~
include/linux/mm.h: In function 'folio_nid':
>> include/linux/mm.h:1382:27: error: dereferencing pointer to incomplete type 'const struct folio'
1382 | return page_to_nid(&folio->page);
| ^~
In file included from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from arch/x86/kernel/asm-offsets.c:13:
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:375:44: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ^~~~~
include/linux/memcontrol.h:399:55: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
399 | static inline struct mem_cgroup *__folio_memcg(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h: In function '__folio_memcg':
include/linux/memcontrol.h:401:34: error: dereferencing pointer to incomplete type 'struct folio'
401 | unsigned long memcg_data = folio->memcg_data;
| ^~
>> include/linux/memcontrol.h:403:2: error: implicit declaration of function 'VM_BUG_ON_FOLIO'; did you mean 'VM_BUG_ON_MM'? [-Werror=implicit-function-declaration]
403 | VM_BUG_ON_FOLIO(folio_slab(folio), folio);
| ^~~~~~~~~~~~~~~
| VM_BUG_ON_MM
>> include/linux/memcontrol.h:403:18: error: implicit declaration of function 'folio_slab' [-Werror=implicit-function-declaration]
403 | VM_BUG_ON_FOLIO(folio_slab(folio), folio);
| ^~~~~~~~~~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:420:55: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
420 | static inline struct obj_cgroup *__folio_objcg(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h: In function '__folio_objcg':
include/linux/memcontrol.h:422:34: error: dereferencing pointer to incomplete type 'struct folio'
422 | unsigned long memcg_data = folio->memcg_data;
| ^~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:451:53: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
451 | static inline struct mem_cgroup *folio_memcg(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h: In function 'folio_memcg':
>> include/linux/memcontrol.h:453:23: error: passing argument 1 of 'folio_memcg_kmem' from incompatible pointer type [-Werror=incompatible-pointer-types]
453 | if (folio_memcg_kmem(folio))
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:375:51: note: expected 'struct folio *' but argument is of type 'struct folio *'
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ~~~~~~~~~~~~~~^~~~~
>> include/linux/memcontrol.h:454:41: error: passing argument 1 of '__folio_objcg' from incompatible pointer type [-Werror=incompatible-pointer-types]
454 | return obj_cgroup_memcg(__folio_objcg(folio));
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:420:62: note: expected 'struct folio *' but argument is of type 'struct folio *'
420 | static inline struct obj_cgroup *__folio_objcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
>> include/linux/memcontrol.h:455:23: error: passing argument 1 of '__folio_memcg' from incompatible pointer type [-Werror=incompatible-pointer-types]
455 | return __folio_memcg(folio);
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:399:62: note: expected 'struct folio *' but argument is of type 'struct folio *'
399 | static inline struct mem_cgroup *__folio_memcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h: In function 'page_memcg':
>> include/linux/memcontrol.h:460:21: error: implicit declaration of function 'page_folio' [-Werror=implicit-function-declaration]
460 | return folio_memcg(page_folio(page));
| ^~~~~~~~~~
include/linux/memcontrol.h:460:21: warning: passing argument 1 of 'folio_memcg' makes pointer from integer without a cast [-Wint-conversion]
460 | return folio_memcg(page_folio(page));
| ^~~~~~~~~~~~~~~~
| |
| int
include/linux/memcontrol.h:451:60: note: expected 'struct folio *' but argument is of type 'int'
451 | static inline struct mem_cgroup *folio_memcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:540:44: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
540 | static inline bool folio_memcg_kmem(struct folio *folio)
| ^~~~~
>> include/linux/memcontrol.h:540:20: error: conflicting types for 'folio_memcg_kmem'
540 | static inline bool folio_memcg_kmem(struct folio *folio)
| ^~~~~~~~~~~~~~~~
include/linux/memcontrol.h:375:20: note: previous declaration of 'folio_memcg_kmem' was here
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ^~~~~~~~~~~~~~~~
In file included from include/asm-generic/atomic-instrumented.h:20,
from include/linux/atomic.h:81,
from include/linux/crypto.h:15,
from arch/x86/kernel/asm-offsets.c:9:
include/linux/memcontrol.h: In function 'folio_memcg_kmem':
include/linux/memcontrol.h:542:35: error: dereferencing pointer to incomplete type 'struct folio'
542 | VM_BUG_ON_PGFLAGS(PageTail(&folio->page), &folio->page);
| ^~
include/linux/build_bug.h:30:63: note: in definition of macro 'BUILD_BUG_ON_INVALID'
30 | #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
| ^
include/linux/memcontrol.h:542:2: note: in expansion of macro 'VM_BUG_ON_PGFLAGS'
542 | VM_BUG_ON_PGFLAGS(PageTail(&folio->page), &folio->page);
| ^~~~~~~~~~~~~~~~~
In file included from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from arch/x86/kernel/asm-offsets.c:13:
include/linux/memcontrol.h: In function 'PageMemcgKmem':
include/linux/memcontrol.h:606:26: warning: passing argument 1 of 'folio_memcg_kmem' makes pointer from integer without a cast [-Wint-conversion]
606 | return folio_memcg_kmem(page_folio(page));
| ^~~~~~~~~~~~~~~~
| |
| int
include/linux/memcontrol.h:540:51: note: expected 'struct folio *' but argument is of type 'int'
540 | static inline bool folio_memcg_kmem(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
arch/x86/kernel/asm-offsets.c: At top level:
include/linux/memcontrol.h:375:20: warning: 'folio_memcg_kmem' used but never defined
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ^~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:117: arch/x86/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1212: prepare0] Error 2
make[1]: Target 'modules_prepare' not remade because of errors.
make: *** [Makefile:220: __sub-make] Error 2
make: Target 'modules_prepare' not remade because of errors.
--
In file included from include/linux/kallsyms.h:13,
from include/linux/bpf.h:20,
from include/linux/bpf-cgroup.h:5,
from include/linux/cgroup-defs.h:22,
from include/linux/cgroup.h:28,
from include/linux/memcontrol.h:13,
from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from arch/x86/kernel/asm-offsets.c:13:
include/linux/mm.h:1380:42: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
1380 | static inline int folio_nid(const struct folio *folio)
| ^~~~~
include/linux/mm.h: In function 'folio_nid':
>> include/linux/mm.h:1382:27: error: dereferencing pointer to incomplete type 'const struct folio'
1382 | return page_to_nid(&folio->page);
| ^~
In file included from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from arch/x86/kernel/asm-offsets.c:13:
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:375:44: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ^~~~~
include/linux/memcontrol.h:399:55: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
399 | static inline struct mem_cgroup *__folio_memcg(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h: In function '__folio_memcg':
include/linux/memcontrol.h:401:34: error: dereferencing pointer to incomplete type 'struct folio'
401 | unsigned long memcg_data = folio->memcg_data;
| ^~
>> include/linux/memcontrol.h:403:2: error: implicit declaration of function 'VM_BUG_ON_FOLIO'; did you mean 'VM_BUG_ON_MM'? [-Werror=implicit-function-declaration]
403 | VM_BUG_ON_FOLIO(folio_slab(folio), folio);
| ^~~~~~~~~~~~~~~
| VM_BUG_ON_MM
>> include/linux/memcontrol.h:403:18: error: implicit declaration of function 'folio_slab' [-Werror=implicit-function-declaration]
403 | VM_BUG_ON_FOLIO(folio_slab(folio), folio);
| ^~~~~~~~~~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:420:55: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
420 | static inline struct obj_cgroup *__folio_objcg(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h: In function '__folio_objcg':
include/linux/memcontrol.h:422:34: error: dereferencing pointer to incomplete type 'struct folio'
422 | unsigned long memcg_data = folio->memcg_data;
| ^~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:451:53: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
451 | static inline struct mem_cgroup *folio_memcg(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h: In function 'folio_memcg':
>> include/linux/memcontrol.h:453:23: error: passing argument 1 of 'folio_memcg_kmem' from incompatible pointer type [-Werror=incompatible-pointer-types]
453 | if (folio_memcg_kmem(folio))
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:375:51: note: expected 'struct folio *' but argument is of type 'struct folio *'
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ~~~~~~~~~~~~~~^~~~~
>> include/linux/memcontrol.h:454:41: error: passing argument 1 of '__folio_objcg' from incompatible pointer type [-Werror=incompatible-pointer-types]
454 | return obj_cgroup_memcg(__folio_objcg(folio));
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:420:62: note: expected 'struct folio *' but argument is of type 'struct folio *'
420 | static inline struct obj_cgroup *__folio_objcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
>> include/linux/memcontrol.h:455:23: error: passing argument 1 of '__folio_memcg' from incompatible pointer type [-Werror=incompatible-pointer-types]
455 | return __folio_memcg(folio);
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:399:62: note: expected 'struct folio *' but argument is of type 'struct folio *'
399 | static inline struct mem_cgroup *__folio_memcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h: In function 'page_memcg':
>> include/linux/memcontrol.h:460:21: error: implicit declaration of function 'page_folio' [-Werror=implicit-function-declaration]
460 | return folio_memcg(page_folio(page));
| ^~~~~~~~~~
include/linux/memcontrol.h:460:21: warning: passing argument 1 of 'folio_memcg' makes pointer from integer without a cast [-Wint-conversion]
460 | return folio_memcg(page_folio(page));
| ^~~~~~~~~~~~~~~~
| |
| int
include/linux/memcontrol.h:451:60: note: expected 'struct folio *' but argument is of type 'int'
451 | static inline struct mem_cgroup *folio_memcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:540:44: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
540 | static inline bool folio_memcg_kmem(struct folio *folio)
| ^~~~~
>> include/linux/memcontrol.h:540:20: error: conflicting types for 'folio_memcg_kmem'
540 | static inline bool folio_memcg_kmem(struct folio *folio)
| ^~~~~~~~~~~~~~~~
include/linux/memcontrol.h:375:20: note: previous declaration of 'folio_memcg_kmem' was here
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ^~~~~~~~~~~~~~~~
In file included from include/asm-generic/atomic-instrumented.h:20,
from include/linux/atomic.h:81,
from include/linux/crypto.h:15,
from arch/x86/kernel/asm-offsets.c:9:
include/linux/memcontrol.h: In function 'folio_memcg_kmem':
include/linux/memcontrol.h:542:35: error: dereferencing pointer to incomplete type 'struct folio'
542 | VM_BUG_ON_PGFLAGS(PageTail(&folio->page), &folio->page);
| ^~
include/linux/build_bug.h:30:63: note: in definition of macro 'BUILD_BUG_ON_INVALID'
30 | #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
| ^
include/linux/memcontrol.h:542:2: note: in expansion of macro 'VM_BUG_ON_PGFLAGS'
542 | VM_BUG_ON_PGFLAGS(PageTail(&folio->page), &folio->page);
| ^~~~~~~~~~~~~~~~~
In file included from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from arch/x86/kernel/asm-offsets.c:13:
include/linux/memcontrol.h: In function 'PageMemcgKmem':
include/linux/memcontrol.h:606:26: warning: passing argument 1 of 'folio_memcg_kmem' makes pointer from integer without a cast [-Wint-conversion]
606 | return folio_memcg_kmem(page_folio(page));
| ^~~~~~~~~~~~~~~~
| |
| int
include/linux/memcontrol.h:540:51: note: expected 'struct folio *' but argument is of type 'int'
540 | static inline bool folio_memcg_kmem(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
arch/x86/kernel/asm-offsets.c: At top level:
include/linux/memcontrol.h:375:20: warning: 'folio_memcg_kmem' used but never defined
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ^~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:117: arch/x86/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1212: prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:220: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.
vim +403 include/linux/memcontrol.h
388
389 /*
390 * __folio_memcg - Get the memory cgroup associated with a non-kmem folio
391 * @folio: Pointer to the folio.
392 *
393 * Returns a pointer to the memory cgroup associated with the folio,
394 * or NULL. This function assumes that the folio is known to have a
395 * proper memory cgroup pointer. It's not safe to call this function
396 * against some type of folios, e.g. slab folios or ex-slab folios or
397 * kmem folios.
398 */
399 static inline struct mem_cgroup *__folio_memcg(struct folio *folio)
400 {
401 unsigned long memcg_data = folio->memcg_data;
402
> 403 VM_BUG_ON_FOLIO(folio_slab(folio), folio);
404 VM_BUG_ON_FOLIO(memcg_data & MEMCG_DATA_OBJCGS, folio);
405 VM_BUG_ON_FOLIO(memcg_data & MEMCG_DATA_KMEM, folio);
406
407 return (struct mem_cgroup *)(memcg_data & ~MEMCG_DATA_FLAGS_MASK);
408 }
409
410 /*
411 * __folio_objcg - get the object cgroup associated with a kmem folio.
412 * @folio: Pointer to the folio.
413 *
414 * Returns a pointer to the object cgroup associated with the folio,
415 * or NULL. This function assumes that the folio is known to have a
416 * proper object cgroup pointer. It's not safe to call this function
417 * against some type of folios, e.g. slab folios or ex-slab folios or
418 * LRU folios.
419 */
420 static inline struct obj_cgroup *__folio_objcg(struct folio *folio)
421 {
422 unsigned long memcg_data = folio->memcg_data;
423
424 VM_BUG_ON_FOLIO(folio_slab(folio), folio);
425 VM_BUG_ON_FOLIO(memcg_data & MEMCG_DATA_OBJCGS, folio);
426 VM_BUG_ON_FOLIO(!(memcg_data & MEMCG_DATA_KMEM), folio);
427
428 return (struct obj_cgroup *)(memcg_data & ~MEMCG_DATA_FLAGS_MASK);
429 }
430
431 /*
432 * folio_memcg - Get the memory cgroup associated with a folio.
433 * @folio: Pointer to the folio.
434 *
435 * Returns a pointer to the memory cgroup associated with the folio,
436 * or NULL. This function assumes that the folio is known to have a
437 * proper memory cgroup pointer. It's not safe to call this function
438 * against some type of folios, e.g. slab folios or ex-slab folios.
439 *
440 * For a non-kmem folio any of the following ensures folio and memcg binding
441 * stability:
442 *
443 * - the folio lock
444 * - LRU isolation
445 * - lock_page_memcg()
446 * - exclusive reference
447 *
448 * For a kmem folio a caller should hold an rcu read lock to protect memcg
449 * associated with a kmem folio from being released.
450 */
451 static inline struct mem_cgroup *folio_memcg(struct folio *folio)
452 {
> 453 if (folio_memcg_kmem(folio))
> 454 return obj_cgroup_memcg(__folio_objcg(folio));
> 455 return __folio_memcg(folio);
456 }
457
458 static inline struct mem_cgroup *page_memcg(struct page *page)
459 {
> 460 return folio_memcg(page_folio(page));
461 }
462
463 /*
464 * page_memcg_rcu - locklessly get the memory cgroup associated with a page
465 * @page: a pointer to the page struct
466 *
467 * Returns a pointer to the memory cgroup associated with the page,
468 * or NULL. This function assumes that the page is known to have a
469 * proper memory cgroup pointer. It's not safe to call this function
470 * against some type of pages, e.g. slab pages or ex-slab pages.
471 */
472 static inline struct mem_cgroup *page_memcg_rcu(struct page *page)
473 {
474 unsigned long memcg_data = READ_ONCE(page->memcg_data);
475
476 VM_BUG_ON_PAGE(PageSlab(page), page);
477 WARN_ON_ONCE(!rcu_read_lock_held());
478
479 if (memcg_data & MEMCG_DATA_KMEM) {
480 struct obj_cgroup *objcg;
481
482 objcg = (void *)(memcg_data & ~MEMCG_DATA_FLAGS_MASK);
483 return obj_cgroup_memcg(objcg);
484 }
485
486 return (struct mem_cgroup *)(memcg_data & ~MEMCG_DATA_FLAGS_MASK);
487 }
488
489 /*
490 * page_memcg_check - get the memory cgroup associated with a page
491 * @page: a pointer to the page struct
492 *
493 * Returns a pointer to the memory cgroup associated with the page,
494 * or NULL. This function unlike page_memcg() can take any page
495 * as an argument. It has to be used in cases when it's not known if a page
496 * has an associated memory cgroup pointer or an object cgroups vector or
497 * an object cgroup.
498 *
499 * For a non-kmem page any of the following ensures page and memcg binding
500 * stability:
501 *
502 * - the page lock
503 * - LRU isolation
504 * - lock_page_memcg()
505 * - exclusive reference
506 *
507 * For a kmem page a caller should hold an rcu read lock to protect memcg
508 * associated with a kmem page from being released.
509 */
510 static inline struct mem_cgroup *page_memcg_check(struct page *page)
511 {
512 /*
513 * Because page->memcg_data might be changed asynchronously
514 * for slab pages, READ_ONCE() should be used here.
515 */
516 unsigned long memcg_data = READ_ONCE(page->memcg_data);
517
518 if (memcg_data & MEMCG_DATA_OBJCGS)
519 return NULL;
520
521 if (memcg_data & MEMCG_DATA_KMEM) {
522 struct obj_cgroup *objcg;
523
524 objcg = (void *)(memcg_data & ~MEMCG_DATA_FLAGS_MASK);
525 return obj_cgroup_memcg(objcg);
526 }
527
528 return (struct mem_cgroup *)(memcg_data & ~MEMCG_DATA_FLAGS_MASK);
529 }
530
531 #ifdef CONFIG_MEMCG_KMEM
532 /*
533 * folio_memcg_kmem - Check if the folio has the memcg_kmem flag set.
534 * @folio: Pointer to the folio.
535 *
536 * Checks if the folio has MemcgKmem flag set. The caller must ensure
537 * that the folio has an associated memory cgroup. It's not safe to call
538 * this function against some types of folios, e.g. slab folios.
539 */
> 540 static inline bool folio_memcg_kmem(struct folio *folio)
541 {
542 VM_BUG_ON_PGFLAGS(PageTail(&folio->page), &folio->page);
543 VM_BUG_ON_FOLIO(folio->memcg_data & MEMCG_DATA_OBJCGS, folio);
544 return folio->memcg_data & MEMCG_DATA_KMEM;
545 }
546
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
[dhowells-fs:fscache-iter-2 57/68] fs/fscache/io.c:235: warning: expecting prototype for fscache_clear_page_bits(). Prototype was for __fscache_clear_page_bits() instead
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git fscache-iter-2
head: d45090b191774b11ecfe2421f5619827aa08ad00
commit: e29afe6f941d92e05bfaf15c9fcb4fbc4760244f [57/68] fscache: Add support for writing to the cache
config: m68k-buildonly-randconfig-r005-20210712 (attached as .config)
compiler: m68k-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 fscache-iter-2
git checkout e29afe6f941d92e05bfaf15c9fcb4fbc4760244f
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross O=build_dir ARCH=m68k SHELL=/bin/bash drivers/nvme/target/ fs/fscache/
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/fscache/io.c:25: warning: Function parameter or member 'cres' not described in 'fscache_wait_for_operation'
fs/fscache/io.c:25: warning: Excess function parameter 'cookie' description in 'fscache_wait_for_operation'
>> fs/fscache/io.c:235: warning: expecting prototype for fscache_clear_page_bits(). Prototype was for __fscache_clear_page_bits() instead
>> fs/fscache/io.c:296: warning: expecting prototype for fscache_write_to_cache(). Prototype was for __fscache_write_to_cache() instead
vim +235 fs/fscache/io.c
223
224 /**
225 * fscache_clear_page_bits - Clear the PG_fscache bits from a set of pages
226 * @mapping: The netfs inode to use as the source
227 * @start: The start position in @mapping
228 * @len: The amount of data to unlock
229 *
230 * Clear the PG_fscache flag from a sequence of pages and wake up anyone who's
231 * waiting.
232 */
233 void __fscache_clear_page_bits(struct address_space *mapping,
234 loff_t start, size_t len)
> 235 {
236 pgoff_t first = start / PAGE_SIZE;
237 pgoff_t last = (start + len - 1) / PAGE_SIZE;
238 struct page *page;
239
240 if (len) {
241 XA_STATE(xas, &mapping->i_pages, first);
242
243 rcu_read_lock();
244 xas_for_each(&xas, page, last) {
245 end_page_fscache(page);
246 }
247 rcu_read_unlock();
248 }
249 }
250 EXPORT_SYMBOL(__fscache_clear_page_bits);
251
252 /*
253 * Deal with the completion of writing the data to the cache.
254 */
255 static void fscache_wreq_done(void *priv, ssize_t transferred_or_error,
256 bool was_async)
257 {
258 struct fscache_write_request *wreq = priv;
259
260 fscache_clear_page_bits(wreq->mapping, wreq->start, wreq->len);
261
262 if (wreq->term_func)
263 wreq->term_func(wreq->term_func_priv, transferred_or_error,
264 was_async);
265 fscache_end_operation(&wreq->cache_resources);
266 kfree(wreq);
267 }
268
269 /**
270 * fscache_write_to_cache - Save a write to the cache and clear PG_fscache
271 * @cookie: The cookie representing the cache object
272 * @mapping: The netfs inode to use as the source
273 * @start: The start position in @mapping
274 * @len: The amount of data to write back
275 * @i_size: The new size of the inode
276 * @term_func: The function to call upon completion
277 * @term_func_priv: The private data for @term_func
278 *
279 * Helper function for a netfs to write dirty data from an inode into the cache
280 * object that's backing it.
281 *
282 * @start and @len describe the range of the data. This does not need to be
283 * page-aligned, but to satisfy DIO requirements, the cache may expand it up to
284 * the page boundaries on either end. All the pages covering the range must be
285 * marked with PG_fscache.
286 *
287 * If given, @term_func will be called upon completion and supplied with
288 * @term_func_priv. Note that the PG_fscache flags will have been cleared by
289 * this point, so the netfs must retain its own pin on the mapping.
290 */
291 void __fscache_write_to_cache(struct fscache_cookie *cookie,
292 struct address_space *mapping,
293 loff_t start, size_t len, loff_t i_size,
294 netfs_io_terminated_t term_func,
295 void *term_func_priv)
> 296 {
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
[hare-scsi-devel:auth.v2 6/12] drivers/nvme/host/auth.c:40:5: warning: no previous prototype for 'nvme_auth_send'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git auth.v2
head: 9107ea4a3526c6801b38b7a2345b7372278a35ba
commit: 723befd959651e629874f9ce9f4a322c4dbe008b [6/12] nvme: Implement In-Band authentication
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git/commi...
git remote add hare-scsi-devel https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git
git fetch --no-tags hare-scsi-devel auth.v2
git checkout 723befd959651e629874f9ce9f4a322c4dbe008b
# 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 warnings (new ones prefixed by >>):
>> drivers/nvme/host/auth.c:40:5: warning: no previous prototype for 'nvme_auth_send' [-Wmissing-prototypes]
40 | int nvme_auth_send(struct nvme_ctrl *ctrl, int qid, void *data, size_t tl)
| ^~~~~~~~~~~~~~
>> drivers/nvme/host/auth.c:64:5: warning: no previous prototype for 'nvme_auth_receive' [-Wmissing-prototypes]
64 | int nvme_auth_receive(struct nvme_ctrl *ctrl, int qid, void *buf, size_t al,
| ^~~~~~~~~~~~~~~~~
>> drivers/nvme/host/auth.c:117:5: warning: no previous prototype for 'nvme_auth_dhchap_negotiate' [-Wmissing-prototypes]
117 | int nvme_auth_dhchap_negotiate(struct nvme_ctrl *ctrl,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/nvme/host/auth.c:144:5: warning: no previous prototype for 'nvme_auth_dhchap_challenge' [-Wmissing-prototypes]
144 | int nvme_auth_dhchap_challenge(struct nvme_ctrl *ctrl,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/nvme/host/auth.c:214:5: warning: no previous prototype for 'nvme_auth_dhchap_reply' [-Wmissing-prototypes]
214 | int nvme_auth_dhchap_reply(struct nvme_ctrl *ctrl,
| ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/nvme/host/auth.c:257:5: warning: no previous prototype for 'nvme_auth_dhchap_success1' [-Wmissing-prototypes]
257 | int nvme_auth_dhchap_success1(struct nvme_ctrl *ctrl,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/nvme/host/auth.c:302:5: warning: no previous prototype for 'nvme_auth_dhchap_success2' [-Wmissing-prototypes]
302 | int nvme_auth_dhchap_success2(struct nvme_ctrl *ctrl,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/nvme/host/auth.c:317:5: warning: no previous prototype for 'nvme_auth_dhchap_failure2' [-Wmissing-prototypes]
317 | int nvme_auth_dhchap_failure2(struct nvme_ctrl *ctrl,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/nvme/host/auth.c:334:5: warning: no previous prototype for 'nvme_auth_select_hash' [-Wmissing-prototypes]
334 | int nvme_auth_select_hash(struct nvme_ctrl *ctrl,
| ^~~~~~~~~~~~~~~~~~~~~
>> drivers/nvme/host/auth.c:385:5: warning: no previous prototype for 'nvme_auth_dhchap_host_response' [-Wmissing-prototypes]
385 | int nvme_auth_dhchap_host_response(struct nvme_ctrl *ctrl,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/nvme/host/auth.c:432:5: warning: no previous prototype for 'nvme_auth_dhchap_controller_response' [-Wmissing-prototypes]
432 | int nvme_auth_dhchap_controller_response(struct nvme_ctrl *ctrl,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/nvme/host/auth.c:485:5: warning: no previous prototype for 'nvme_auth_generate_key' [-Wmissing-prototypes]
485 | int nvme_auth_generate_key(struct nvme_ctrl *ctrl,
| ^~~~~~~~~~~~~~~~~~~~~~
vim +/nvme_auth_send +40 drivers/nvme/host/auth.c
39
> 40 int nvme_auth_send(struct nvme_ctrl *ctrl, int qid, void *data, size_t tl)
41 {
42 struct nvme_command cmd = {};
43 blk_mq_req_flags_t flags = qid == NVME_QID_ANY ?
44 0 : BLK_MQ_REQ_NOWAIT | BLK_MQ_REQ_RESERVED;
45 struct request_queue *q = qid == NVME_QID_ANY ?
46 ctrl->fabrics_q : ctrl->connect_q;
47 int ret;
48
49 cmd.auth_send.opcode = nvme_fabrics_command;
50 cmd.auth_send.fctype = nvme_fabrics_type_auth_send;
51 cmd.auth_send.secp = NVME_AUTH_DHCHAP_PROTOCOL_IDENTIFIER;
52 cmd.auth_send.spsp0 = 0x01;
53 cmd.auth_send.spsp1 = 0x01;
54 cmd.auth_send.tl = tl;
55
56 ret = __nvme_submit_sync_cmd(q, &cmd, NULL, data, tl, 0, qid,
57 0, flags);
58 if (ret)
59 dev_dbg(ctrl->device,
60 "%s: qid %d error %d\n", __func__, qid, ret);
61 return ret;
62 }
63
> 64 int nvme_auth_receive(struct nvme_ctrl *ctrl, int qid, void *buf, size_t al,
65 u16 transaction, u8 expected_msg )
66 {
67 struct nvme_command cmd = {};
68 struct nvmf_auth_dhchap_failure_data *data = buf;
69 blk_mq_req_flags_t flags = qid == NVME_QID_ANY ?
70 0 : BLK_MQ_REQ_NOWAIT | BLK_MQ_REQ_RESERVED;
71 struct request_queue *q = qid == NVME_QID_ANY ?
72 ctrl->fabrics_q : ctrl->connect_q;
73 int ret;
74
75 cmd.auth_receive.opcode = nvme_fabrics_command;
76 cmd.auth_receive.fctype = nvme_fabrics_type_auth_receive;
77 cmd.auth_receive.secp = NVME_AUTH_DHCHAP_PROTOCOL_IDENTIFIER;
78 cmd.auth_receive.spsp0 = 0x01;
79 cmd.auth_receive.spsp1 = 0x01;
80 cmd.auth_receive.al = al;
81
82 ret = __nvme_submit_sync_cmd(q, &cmd, NULL, buf, al, 0, qid,
83 0, flags);
84 if (ret > 0) {
85 dev_dbg(ctrl->device, "%s: qid %d nvme status %x\n",
86 __func__, qid, ret);
87 ret = -EIO;
88 }
89 if (ret < 0) {
90 dev_dbg(ctrl->device, "%s: qid %d error %d\n",
91 __func__, qid, ret);
92 return ret;
93 }
94 dev_dbg(ctrl->device, "%s: qid %d auth_type %d auth_id %x\n",
95 __func__, qid, data->auth_type, data->auth_id);
96 if (data->auth_type == NVME_AUTH_COMMON_MESSAGES &&
97 data->auth_id == NVME_AUTH_DHCHAP_MESSAGE_FAILURE1) {
98 return data->reason_code_explanation;
99 }
100 if (data->auth_type != NVME_AUTH_DHCHAP_MESSAGES ||
101 data->auth_id != expected_msg) {
102 dev_warn(ctrl->device,
103 "%s: qid %d invalid message type %02x/%02x\n",
104 __func__, qid, data->auth_type, data->auth_id);
105 return NVME_AUTH_DHCHAP_FAILURE_INVALID_PAYLOAD;
106 }
107 if (le16_to_cpu(data->t_id) != transaction) {
108 dev_warn(ctrl->device,
109 "%s: qid %d invalid transaction ID %d\n",
110 __func__, qid, le16_to_cpu(data->t_id));
111 return NVME_AUTH_DHCHAP_FAILURE_INVALID_PAYLOAD;
112 }
113
114 return 0;
115 }
116
> 117 int nvme_auth_dhchap_negotiate(struct nvme_ctrl *ctrl,
118 struct nvme_dhchap_context *chap,
119 void *buf, size_t buf_size)
120 {
121 struct nvmf_auth_dhchap_negotiate_data *data = buf;
122 size_t size = sizeof(*data) + sizeof(union nvmf_auth_protocol);
123
124 if (buf_size < size)
125 return -EINVAL;
126
127 memset((u8 *)buf, 0, size);
128 data->auth_type = NVME_AUTH_COMMON_MESSAGES;
129 data->auth_id = NVME_AUTH_DHCHAP_MESSAGE_NEGOTIATE;
130 data->t_id = cpu_to_le16(chap->transaction);
131 data->sc_c = 0; /* No secure channel concatenation */
132 data->napd = 1;
133 data->auth_protocol[0].dhchap.authid = NVME_AUTH_DHCHAP_AUTH_ID;
134 data->auth_protocol[0].dhchap.halen = 3;
135 data->auth_protocol[0].dhchap.dhlen = 1;
136 data->auth_protocol[0].dhchap.idlist[0] = NVME_AUTH_DHCHAP_HASH_SHA256;
137 data->auth_protocol[0].dhchap.idlist[1] = NVME_AUTH_DHCHAP_HASH_SHA384;
138 data->auth_protocol[0].dhchap.idlist[2] = NVME_AUTH_DHCHAP_HASH_SHA512;
139 data->auth_protocol[0].dhchap.idlist[3] = NVME_AUTH_DHCHAP_DHGROUP_NULL;
140
141 return size;
142 }
143
> 144 int nvme_auth_dhchap_challenge(struct nvme_ctrl *ctrl,
145 struct nvme_dhchap_context *chap,
146 void *buf, size_t buf_size)
147 {
148 struct nvmf_auth_dhchap_challenge_data *data = buf;
149 size_t size = sizeof(*data) + data->hl + data->dhvlen;
150 const char *gid_name;
151
152 if (buf_size < size) {
153 chap->status = NVME_AUTH_DHCHAP_FAILURE_INVALID_PAYLOAD;
154 return -ENOMSG;
155 }
156
157 if (data->hashid != NVME_AUTH_DHCHAP_HASH_SHA256 &&
158 data->hashid != NVME_AUTH_DHCHAP_HASH_SHA384 &&
159 data->hashid != NVME_AUTH_DHCHAP_HASH_SHA512) {
160 dev_warn(ctrl->device,
161 "qid %d: DH-HMAC-CHAP: invalid HASH ID %d\n",
162 chap->qid, data->hashid);
163 chap->status = NVME_AUTH_DHCHAP_FAILURE_HASH_UNUSABLE;
164 return -EPROTO;
165 }
166 switch (data->dhgid) {
167 case NVME_AUTH_DHCHAP_DHGROUP_NULL:
168 gid_name = "null";
169 break;
170 default:
171 gid_name = NULL;
172 break;
173 }
174 if (!gid_name) {
175 dev_warn(ctrl->device,
176 "qid %d: DH-HMAC-CHAP: invalid DH group id %d\n",
177 chap->qid, data->dhgid);
178 chap->status = NVME_AUTH_DHCHAP_FAILURE_DHGROUP_UNUSABLE;
179 return -EPROTO;
180 }
181 if (data->dhgid != NVME_AUTH_DHCHAP_DHGROUP_NULL) {
182 chap->status = NVME_AUTH_DHCHAP_FAILURE_DHGROUP_UNUSABLE;
183 return -EPROTO;
184 }
185 if (data->dhgid == NVME_AUTH_DHCHAP_DHGROUP_NULL && data->dhvlen != 0) {
186 dev_warn(ctrl->device,
187 "qid %d: DH-HMAC-CHAP: invalid DH value for NULL DH\n",
188 chap->qid);
189 chap->status = NVME_AUTH_DHCHAP_FAILURE_DHGROUP_UNUSABLE;
190 return -EPROTO;
191 }
192 dev_dbg(ctrl->device, "%s: qid %d requested hash id %d\n",
193 __func__, chap->qid, data->hashid);
194 chap->hash_id = data->hashid;
195 if ((data->hashid == NVME_AUTH_DHCHAP_HASH_SHA256 &&
196 data->hl != 32) ||
197 (data->hashid == NVME_AUTH_DHCHAP_HASH_SHA384 &&
198 data->hl != 48) ||
199 (data->hashid == NVME_AUTH_DHCHAP_HASH_SHA512 &&
200 data->hl != 64)) {
201 dev_warn(ctrl->device,
202 "qid %d: DH-HMAC-CHAP: invalid hash length\n",
203 chap->qid);
204 chap->status = NVME_AUTH_DHCHAP_FAILURE_HASH_UNUSABLE;
205 return -EPROTO;
206 }
207 chap->hash_len = data->hl;
208 chap->s1 = le32_to_cpu(data->seqnum);
209 memcpy(chap->c1, data->cval, chap->hash_len);
210
211 return 0;
212 }
213
> 214 int nvme_auth_dhchap_reply(struct nvme_ctrl *ctrl,
215 struct nvme_dhchap_context *chap,
216 void *buf, size_t buf_size)
217 {
218 struct nvmf_auth_dhchap_reply_data *data = buf;
219 size_t size = sizeof(*data);
220
221 size += 2 * chap->hash_len;
222 if (ctrl->opts->dhchap_auth) {
223 get_random_bytes(chap->c2, chap->hash_len);
224 chap->s2 = nvme_dhchap_seqnum++;
225 } else
226 memset(chap->c2, 0, chap->hash_len);
227
228 if (chap->host_key_len)
229 size += chap->host_key_len;
230
231 if (buf_size < size)
232 return -EINVAL;
233
234 memset(buf, 0, size);
235 data->auth_type = NVME_AUTH_DHCHAP_MESSAGES;
236 data->auth_id = NVME_AUTH_DHCHAP_MESSAGE_REPLY;
237 data->t_id = cpu_to_le16(chap->transaction);
238 data->hl = chap->hash_len;
239 data->dhvlen = chap->host_key_len;
240 data->seqnum = cpu_to_le32(chap->s2);
241 memcpy(data->rval, chap->response, chap->hash_len);
242 if (ctrl->opts->dhchap_auth) {
243 dev_dbg(ctrl->device, "%s: qid %d ctrl challenge %*ph\n",
244 __func__, chap->qid,
245 chap->hash_len, chap->c2);
246 data->cvalid = 1;
247 memcpy(data->rval + chap->hash_len, chap->c2,
248 chap->hash_len);
249 }
250 if (chap->host_key_len)
251 memcpy(data->rval + 2 * chap->hash_len, chap->host_key,
252 chap->host_key_len);
253
254 return size;
255 }
256
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
mm/sparse.c:145:2: warning: int result is returned as long value. If the return value is long to avoid loss of information, then you have loss of information. [truncLongCastReturn]
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: e73f0f0ee7541171d89f2e2491130c7771ba58d3
commit: 36d40290c8f71daf1ba5567ab14574f36b9b8d6a alpha: switch from DISCONTIGMEM to SPARSEMEM
date: 7 months ago
compiler: alpha-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
cppcheck warnings: (new ones prefixed by >>)
>> mm/sparse.c:145:2: warning: int result is returned as long value. If the return value is long to avoid loss of information, then you have loss of information. [truncLongCastReturn]
return (nid << SECTION_NID_SHIFT);
^
vim +145 mm/sparse.c
4ca644d970bf25 Dave Hansen 2005-10-29 136
30c253e6da655d Andy Whitcroft 2006-06-23 137 /*
30c253e6da655d Andy Whitcroft 2006-06-23 138 * During early boot, before section_mem_map is used for an actual
30c253e6da655d Andy Whitcroft 2006-06-23 139 * mem_map, we use section_mem_map to store the section's NUMA
30c253e6da655d Andy Whitcroft 2006-06-23 140 * node. This keeps us from having to use another data structure. The
30c253e6da655d Andy Whitcroft 2006-06-23 141 * node information is cleared just before we store the real mem_map.
30c253e6da655d Andy Whitcroft 2006-06-23 142 */
30c253e6da655d Andy Whitcroft 2006-06-23 143 static inline unsigned long sparse_encode_early_nid(int nid)
30c253e6da655d Andy Whitcroft 2006-06-23 144 {
30c253e6da655d Andy Whitcroft 2006-06-23 @145 return (nid << SECTION_NID_SHIFT);
30c253e6da655d Andy Whitcroft 2006-06-23 146 }
30c253e6da655d Andy Whitcroft 2006-06-23 147
:::::: The code at line 145 was first introduced by commit
:::::: 30c253e6da655d73eb8bfe2adca9b8f4d82fb81e [PATCH] sparsemem: record nid during memory present
:::::: TO: Andy Whitcroft <apw(a)shadowen.org>
:::::: CC: Linus Torvalds <torvalds(a)g5.osdl.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months