All of lore.kernel.org
 help / color / mirror / Atom feed
* [sashal-linux-stable:queue-5.4 136/137] fs/btrfs/file.c:2664:16: error: 'drop_args' undeclared
@ 2021-05-08 17:40 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-05-08 17:40 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 9130 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git queue-5.4
head:   aef7415b52ffa3bd0111b7b7a3dd47e27584a1e0
commit: 3744bdfd37eaa635ddb70f15fe5d3bde233e54f0 [136/137] btrfs: fix a potential hole punching failure
config: i386-randconfig-m021-20210509 (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/sashal/linux-stable.git/commit/?id=3744bdfd37eaa635ddb70f15fe5d3bde233e54f0
        git remote add sashal-linux-stable https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
        git fetch --no-tags sashal-linux-stable queue-5.4
        git checkout 3744bdfd37eaa635ddb70f15fe5d3bde233e54f0
        # save the attached .config to linux build tree
        make W=1 W=1 ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   fs/btrfs/file.c: In function 'btrfs_punch_hole_range':
>> fs/btrfs/file.c:2664:16: error: 'drop_args' undeclared (first use in this function)
    2664 |   cur_offset = drop_args.drop_end;
         |                ^~~~~~~~~
   fs/btrfs/file.c:2664:16: note: each undeclared identifier is reported only once for each function it appears in


vim +/drop_args +2664 fs/btrfs/file.c

  2534	
  2535	/*
  2536	 * The respective range must have been previously locked, as well as the inode.
  2537	 * The end offset is inclusive (last byte of the range).
  2538	 * @clone_info is NULL for fallocate's hole punching and non-NULL for extent
  2539	 * cloning.
  2540	 * When cloning, we don't want to end up in a state where we dropped extents
  2541	 * without inserting a new one, so we must abort the transaction to avoid a
  2542	 * corruption.
  2543	 */
  2544	int btrfs_punch_hole_range(struct inode *inode, struct btrfs_path *path,
  2545				   const u64 start, const u64 end,
  2546				   struct btrfs_clone_extent_info *clone_info,
  2547				   struct btrfs_trans_handle **trans_out)
  2548	{
  2549		struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
  2550		u64 min_size = btrfs_calc_insert_metadata_size(fs_info, 1);
  2551		u64 ino_size = round_up(inode->i_size, fs_info->sectorsize);
  2552		struct btrfs_root *root = BTRFS_I(inode)->root;
  2553		struct btrfs_trans_handle *trans = NULL;
  2554		struct btrfs_block_rsv *rsv;
  2555		unsigned int rsv_count;
  2556		u64 cur_offset;
  2557		u64 drop_end;
  2558		u64 len = end - start;
  2559		int ret = 0;
  2560	
  2561		if (end <= start)
  2562			return -EINVAL;
  2563	
  2564		rsv = btrfs_alloc_block_rsv(fs_info, BTRFS_BLOCK_RSV_TEMP);
  2565		if (!rsv) {
  2566			ret = -ENOMEM;
  2567			goto out;
  2568		}
  2569		rsv->size = btrfs_calc_insert_metadata_size(fs_info, 1);
  2570		rsv->failfast = 1;
  2571	
  2572		/*
  2573		 * 1 - update the inode
  2574		 * 1 - removing the extents in the range
  2575		 * 1 - adding the hole extent if no_holes isn't set or if we are cloning
  2576		 *     an extent
  2577		 */
  2578		if (!btrfs_fs_incompat(fs_info, NO_HOLES) || clone_info)
  2579			rsv_count = 3;
  2580		else
  2581			rsv_count = 2;
  2582	
  2583		trans = btrfs_start_transaction(root, rsv_count);
  2584		if (IS_ERR(trans)) {
  2585			ret = PTR_ERR(trans);
  2586			trans = NULL;
  2587			goto out_free;
  2588		}
  2589	
  2590		ret = btrfs_block_rsv_migrate(&fs_info->trans_block_rsv, rsv,
  2591					      min_size, false);
  2592		BUG_ON(ret);
  2593		trans->block_rsv = rsv;
  2594	
  2595		cur_offset = start;
  2596		while (cur_offset < end) {
  2597			ret = __btrfs_drop_extents(trans, root, inode, path,
  2598						   cur_offset, end + 1, &drop_end,
  2599						   1, 0, 0, NULL);
  2600			if (ret != -ENOSPC) {
  2601				/*
  2602				 * When cloning we want to avoid transaction aborts when
  2603				 * nothing was done and we are attempting to clone parts
  2604				 * of inline extents, in such cases -EOPNOTSUPP is
  2605				 * returned by __btrfs_drop_extents() without having
  2606				 * changed anything in the file.
  2607				 */
  2608				if (clone_info && ret && ret != -EOPNOTSUPP)
  2609					btrfs_abort_transaction(trans, ret);
  2610				break;
  2611			}
  2612	
  2613			trans->block_rsv = &fs_info->trans_block_rsv;
  2614	
  2615			if (!clone_info && cur_offset < drop_end &&
  2616			    cur_offset < ino_size) {
  2617				ret = fill_holes(trans, BTRFS_I(inode), path,
  2618						cur_offset, drop_end);
  2619				if (ret) {
  2620					/*
  2621					 * If we failed then we didn't insert our hole
  2622					 * entries for the area we dropped, so now the
  2623					 * fs is corrupted, so we must abort the
  2624					 * transaction.
  2625					 */
  2626					btrfs_abort_transaction(trans, ret);
  2627					break;
  2628				}
  2629			}
  2630	
  2631			if (clone_info && drop_end > clone_info->file_offset) {
  2632				u64 clone_len = drop_end - clone_info->file_offset;
  2633	
  2634				ret = btrfs_insert_clone_extent(trans, inode, path,
  2635								clone_info, clone_len);
  2636				if (ret) {
  2637					btrfs_abort_transaction(trans, ret);
  2638					break;
  2639				}
  2640				clone_info->data_len -= clone_len;
  2641				clone_info->data_offset += clone_len;
  2642				clone_info->file_offset += clone_len;
  2643			}
  2644	
  2645			ret = btrfs_update_inode(trans, root, inode);
  2646			if (ret)
  2647				break;
  2648	
  2649			btrfs_end_transaction(trans);
  2650			btrfs_btree_balance_dirty(fs_info);
  2651	
  2652			trans = btrfs_start_transaction(root, rsv_count);
  2653			if (IS_ERR(trans)) {
  2654				ret = PTR_ERR(trans);
  2655				trans = NULL;
  2656				break;
  2657			}
  2658	
  2659			ret = btrfs_block_rsv_migrate(&fs_info->trans_block_rsv,
  2660						      rsv, min_size, false);
  2661			BUG_ON(ret);	/* shouldn't happen */
  2662			trans->block_rsv = rsv;
  2663	
> 2664			cur_offset = drop_args.drop_end;
  2665	                len = end - cur_offset;
  2666			if (!clone_info && len) {
  2667				ret = find_first_non_hole(inode, &cur_offset, &len);
  2668				if (unlikely(ret < 0))
  2669					break;
  2670				if (ret && !len) {
  2671					ret = 0;
  2672					break;
  2673				}
  2674			}
  2675		}
  2676	
  2677		/*
  2678		 * If we were cloning, force the next fsync to be a full one since we
  2679		 * we replaced (or just dropped in the case of cloning holes when
  2680		 * NO_HOLES is enabled) extents and extent maps.
  2681		 * This is for the sake of simplicity, and cloning into files larger
  2682		 * than 16Mb would force the full fsync any way (when
  2683		 * try_release_extent_mapping() is invoked during page cache truncation.
  2684		 */
  2685		if (clone_info)
  2686			set_bit(BTRFS_INODE_NEEDS_FULL_SYNC,
  2687				&BTRFS_I(inode)->runtime_flags);
  2688	
  2689		if (ret)
  2690			goto out_trans;
  2691	
  2692		trans->block_rsv = &fs_info->trans_block_rsv;
  2693		/*
  2694		 * If we are using the NO_HOLES feature we might have had already an
  2695		 * hole that overlaps a part of the region [lockstart, lockend] and
  2696		 * ends at (or beyond) lockend. Since we have no file extent items to
  2697		 * represent holes, drop_end can be less than lockend and so we must
  2698		 * make sure we have an extent map representing the existing hole (the
  2699		 * call to __btrfs_drop_extents() might have dropped the existing extent
  2700		 * map representing the existing hole), otherwise the fast fsync path
  2701		 * will not record the existence of the hole region
  2702		 * [existing_hole_start, lockend].
  2703		 */
  2704		if (drop_end <= end)
  2705			drop_end = end + 1;
  2706		/*
  2707		 * Don't insert file hole extent item if it's for a range beyond eof
  2708		 * (because it's useless) or if it represents a 0 bytes range (when
  2709		 * cur_offset == drop_end).
  2710		 */
  2711		if (!clone_info && cur_offset < ino_size && cur_offset < drop_end) {
  2712			ret = fill_holes(trans, BTRFS_I(inode), path,
  2713					cur_offset, drop_end);
  2714			if (ret) {
  2715				/* Same comment as above. */
  2716				btrfs_abort_transaction(trans, ret);
  2717				goto out_trans;
  2718			}
  2719		}
  2720		if (clone_info) {
  2721			ret = btrfs_insert_clone_extent(trans, inode, path, clone_info,
  2722							clone_info->data_len);
  2723			if (ret) {
  2724				btrfs_abort_transaction(trans, ret);
  2725				goto out_trans;
  2726			}
  2727		}
  2728	
  2729	out_trans:
  2730		if (!trans)
  2731			goto out_free;
  2732	
  2733		trans->block_rsv = &fs_info->trans_block_rsv;
  2734		if (ret)
  2735			btrfs_end_transaction(trans);
  2736		else
  2737			*trans_out = trans;
  2738	out_free:
  2739		btrfs_free_block_rsv(fs_info, rsv);
  2740	out:
  2741		return ret;
  2742	}
  2743	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 30565 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-08 17:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-08 17:40 [sashal-linux-stable:queue-5.4 136/137] fs/btrfs/file.c:2664:16: error: 'drop_args' undeclared kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.