tree: https://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-next.git slab-priority head: a1be3b41415243d20c90e9e92e82808fe1ff91a0 commit: fe049b0156a10dd0bb3fbf3d4dad3ca943874f10 [4/6] remove mapping from balance_dirty_pages*() config: i386-randconfig-a1-201734 (attached as .config) compiler: gcc-5 (Debian 5.4.1-2) 5.4.1 20160904 reproduce: git checkout fe049b0156a10dd0bb3fbf3d4dad3ca943874f10 # save the attached .config to linux build tree make ARCH=i386
All error/warnings (new ones prefixed by >>): fs//ntfs/attrib.c: In function 'ntfs_attr_set': >> fs//ntfs/attrib.c:2549:35: error: implicit declaration of function >> 'inode_to_bdi' [-Werror=implicit-function-declaration] balance_dirty_pages_ratelimited(inode_to_bdi(inode), ^ >> fs//ntfs/attrib.c:2549:35: warning: passing argument 1 of >> 'balance_dirty_pages_ratelimited' makes pointer from integer without a cast >> [-Wint-conversion] In file included from include/linux/memcontrol.h:31:0, from include/linux/swap.h:8, from fs//ntfs/attrib.c:26: include/linux/writeback.h:380:6: note: expected 'struct backing_dev_info *' but argument is of type 'int' void balance_dirty_pages_ratelimited(struct backing_dev_info *bdi, ^ fs//ntfs/attrib.c:2591:35: warning: passing argument 1 of 'balance_dirty_pages_ratelimited' makes pointer from integer without a cast [-Wint-conversion] balance_dirty_pages_ratelimited(inode_to_bdi(inode), ^ In file included from include/linux/memcontrol.h:31:0, from include/linux/swap.h:8, from fs//ntfs/attrib.c:26: include/linux/writeback.h:380:6: note: expected 'struct backing_dev_info *' but argument is of type 'int' void balance_dirty_pages_ratelimited(struct backing_dev_info *bdi, ^ fs//ntfs/attrib.c:2609:35: warning: passing argument 1 of 'balance_dirty_pages_ratelimited' makes pointer from integer without a cast [-Wint-conversion] balance_dirty_pages_ratelimited(inode_to_bdi(inode), ^ In file included from include/linux/memcontrol.h:31:0, from include/linux/swap.h:8, from fs//ntfs/attrib.c:26: include/linux/writeback.h:380:6: note: expected 'struct backing_dev_info *' but argument is of type 'int' void balance_dirty_pages_ratelimited(struct backing_dev_info *bdi, ^ cc1: some warnings being treated as errors vim +/inode_to_bdi +2549 fs//ntfs/attrib.c 2472 2473 /** 2474 * ntfs_attr_set - fill (a part of) an attribute with a byte 2475 * @ni: ntfs inode describing the attribute to fill 2476 * @ofs: offset inside the attribute at which to start to fill 2477 * @cnt: number of bytes to fill 2478 * @val: the unsigned 8-bit value with which to fill the attribute 2479 * 2480 * Fill @cnt bytes of the attribute described by the ntfs inode @ni starting at 2481 * byte offset @ofs inside the attribute with the constant byte @val. 2482 * 2483 * This function is effectively like memset() applied to an ntfs attribute. 2484 * Note thie function actually only operates on the page cache pages belonging 2485 * to the ntfs attribute and it marks them dirty after doing the memset(). 2486 * Thus it relies on the vm dirty page write code paths to cause the modified 2487 * pages to be written to the mft record/disk. 2488 * 2489 * Return 0 on success and -errno on error. An error code of -ESPIPE means 2490 * that @ofs + @cnt were outside the end of the attribute and no write was 2491 * performed. 2492 */ 2493 int ntfs_attr_set(ntfs_inode *ni, const s64 ofs, const s64 cnt, const u8 val) 2494 { 2495 ntfs_volume *vol = ni->vol; 2496 struct inode *inode = VFS_I(ni); 2497 struct address_space *mapping; 2498 struct page *page; 2499 u8 *kaddr; 2500 pgoff_t idx, end; 2501 unsigned start_ofs, end_ofs, size; 2502 2503 ntfs_debug("Entering for ofs 0x%llx, cnt 0x%llx, val 0x%hx.", 2504 (long long)ofs, (long long)cnt, val); 2505 BUG_ON(ofs < 0); 2506 BUG_ON(cnt < 0); 2507 if (!cnt) 2508 goto done; 2509 /* 2510 * FIXME: Compressed and encrypted attributes are not supported when 2511 * writing and we should never have gotten here for them. 2512 */ 2513 BUG_ON(NInoCompressed(ni)); 2514 BUG_ON(NInoEncrypted(ni)); 2515 mapping = VFS_I(ni)->i_mapping; 2516 /* Work out the starting index and page offset. */ 2517 idx = ofs >> PAGE_SHIFT; 2518 start_ofs = ofs & ~PAGE_MASK; 2519 /* Work out the ending index and page offset. */ 2520 end = ofs + cnt; 2521 end_ofs = end & ~PAGE_MASK; 2522 /* If the end is outside the inode size return -ESPIPE. */ 2523 if (unlikely(end > i_size_read(VFS_I(ni)))) { 2524 ntfs_error(vol->sb, "Request exceeds end of attribute."); 2525 return -ESPIPE; 2526 } 2527 end >>= PAGE_SHIFT; 2528 /* If there is a first partial page, need to do it the slow way. */ 2529 if (start_ofs) { 2530 page = read_mapping_page(mapping, idx, NULL); 2531 if (IS_ERR(page)) { 2532 ntfs_error(vol->sb, "Failed to read first partial " 2533 "page (error, index 0x%lx).", idx); 2534 return PTR_ERR(page); 2535 } 2536 /* 2537 * If the last page is the same as the first page, need to 2538 * limit the write to the end offset. 2539 */ 2540 size = PAGE_SIZE; 2541 if (idx == end) 2542 size = end_ofs; 2543 kaddr = kmap_atomic(page); 2544 memset(kaddr + start_ofs, val, size - start_ofs); 2545 flush_dcache_page(page); 2546 kunmap_atomic(kaddr); 2547 set_page_dirty(page); 2548 put_page(page); > 2549 balance_dirty_pages_ratelimited(inode_to_bdi(inode), 2550 inode->i_sb); 2551 cond_resched(); 2552 if (idx == end) 2553 goto done; 2554 idx++; 2555 } 2556 /* Do the whole pages the fast way. */ 2557 for (; idx < end; idx++) { 2558 /* Find or create the current page. (The page is locked.) */ 2559 page = grab_cache_page(mapping, idx); 2560 if (unlikely(!page)) { 2561 ntfs_error(vol->sb, "Insufficient memory to grab " 2562 "page (index 0x%lx).", idx); 2563 return -ENOMEM; 2564 } 2565 kaddr = kmap_atomic(page); 2566 memset(kaddr, val, PAGE_SIZE); 2567 flush_dcache_page(page); 2568 kunmap_atomic(kaddr); 2569 /* 2570 * If the page has buffers, mark them uptodate since buffer 2571 * state and not page state is definitive in 2.6 kernels. 2572 */ 2573 if (page_has_buffers(page)) { 2574 struct buffer_head *bh, *head; 2575 2576 bh = head = page_buffers(page); 2577 do { 2578 set_buffer_uptodate(bh); 2579 } while ((bh = bh->b_this_page) != head); 2580 } 2581 /* Now that buffers are uptodate, set the page uptodate, too. */ 2582 SetPageUptodate(page); 2583 /* 2584 * Set the page and all its buffers dirty and mark the inode 2585 * dirty, too. The VM will write the page later on. 2586 */ 2587 set_page_dirty(page); 2588 /* Finally unlock and release the page. */ 2589 unlock_page(page); 2590 put_page(page); 2591 balance_dirty_pages_ratelimited(inode_to_bdi(inode), 2592 inode->i_sb); 2593 cond_resched(); 2594 } 2595 /* If there is a last partial page, need to do it the slow way. */ 2596 if (end_ofs) { 2597 page = read_mapping_page(mapping, idx, NULL); 2598 if (IS_ERR(page)) { 2599 ntfs_error(vol->sb, "Failed to read last partial page " 2600 "(error, index 0x%lx).", idx); 2601 return PTR_ERR(page); 2602 } 2603 kaddr = kmap_atomic(page); 2604 memset(kaddr, val, end_ofs); 2605 flush_dcache_page(page); 2606 kunmap_atomic(kaddr); 2607 set_page_dirty(page); 2608 put_page(page); 2609 balance_dirty_pages_ratelimited(inode_to_bdi(inode), 2610 inode->i_sb); 2611 cond_resched(); 2612 } 2613 done: 2614 ntfs_debug("Done."); 2615 return 0; 2616 } 2617 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
.config.gz
Description: application/gzip