All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jeff Layton <jlayton@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCH v7 05/11] fs: tracepoints around multigrain timestamp events
Date: Sat, 14 Sep 2024 04:10:19 +0800	[thread overview]
Message-ID: <202409140441.OVFZpmM3-lkp@intel.com> (raw)
In-Reply-To: <20240913-mgtime-v7-5-92d4020e3b00@kernel.org>

Hi Jeff,

kernel test robot noticed the following build warnings:

[auto build test WARNING on da3ea35007d0af457a0afc87e84fddaebc4e0b63]

url:    https://github.com/intel-lab-lkp/linux/commits/Jeff-Layton/timekeeping-move-multigrain-timestamp-floor-handling-into-timekeeper/20240913-215718
base:   da3ea35007d0af457a0afc87e84fddaebc4e0b63
patch link:    https://lore.kernel.org/r/20240913-mgtime-v7-5-92d4020e3b00%40kernel.org
patch subject: [PATCH v7 05/11] fs: tracepoints around multigrain timestamp events
config: x86_64-defconfig (https://download.01.org/0day-ci/archive/20240914/202409140441.OVFZpmM3-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240914/202409140441.OVFZpmM3-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409140441.OVFZpmM3-lkp@intel.com/

All warnings (new ones prefixed by >>):

   fs/inode.c: In function 'inode_set_ctime_current':
>> fs/inode.c:2689:9: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
    2689 |         if (cns == now.tv_nsec && inode->i_ctime_sec == now.tv_sec)
         |         ^~
   fs/inode.c:2691:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
    2691 |                 goto out;
         |                 ^~~~
   fs/inode.c: In function 'inode_set_ctime_deleg':
   fs/inode.c:2771:17: error: implicit declaration of function 'mgtime_counter_inc'; did you mean 'percpu_counter_inc'? [-Werror=implicit-function-declaration]
    2771 |                 mgtime_counter_inc(mg_ctime_swaps);
         |                 ^~~~~~~~~~~~~~~~~~
         |                 percpu_counter_inc
   fs/inode.c:2771:36: error: 'mg_ctime_swaps' undeclared (first use in this function)
    2771 |                 mgtime_counter_inc(mg_ctime_swaps);
         |                                    ^~~~~~~~~~~~~~
   fs/inode.c:2771:36: note: each undeclared identifier is reported only once for each function it appears in
   cc1: some warnings being treated as errors


vim +/if +2689 fs/inode.c

50e17c000c467f Deepa Dinamani 2018-01-21  2642  
3cd886666ff19e Deepa Dinamani 2016-09-14  2643  /**
6190d23e434516 Jeff Layton    2024-09-13  2644   * inode_set_ctime_current - set the ctime to current_time
6190d23e434516 Jeff Layton    2024-09-13  2645   * @inode: inode
3cd886666ff19e Deepa Dinamani 2016-09-14  2646   *
6190d23e434516 Jeff Layton    2024-09-13  2647   * Set the inode's ctime to the current value for the inode. Returns the
6190d23e434516 Jeff Layton    2024-09-13  2648   * current value that was assigned. If this is not a multigrain inode, then we
6190d23e434516 Jeff Layton    2024-09-13  2649   * set it to the later of the coarse time and floor value.
3cd886666ff19e Deepa Dinamani 2016-09-14  2650   *
6190d23e434516 Jeff Layton    2024-09-13  2651   * If it is multigrain, then we first see if the coarse-grained timestamp is
6190d23e434516 Jeff Layton    2024-09-13  2652   * distinct from what we have. If so, then we'll just use that. If we have to
6190d23e434516 Jeff Layton    2024-09-13  2653   * get a fine-grained timestamp, then do so, and try to swap it into the floor.
6190d23e434516 Jeff Layton    2024-09-13  2654   * We accept the new floor value regardless of the outcome of the cmpxchg.
6190d23e434516 Jeff Layton    2024-09-13  2655   * After that, we try to swap the new value into i_ctime_nsec. Again, we take
6190d23e434516 Jeff Layton    2024-09-13  2656   * the resulting ctime, regardless of the outcome of the swap.
3cd886666ff19e Deepa Dinamani 2016-09-14  2657   */
6190d23e434516 Jeff Layton    2024-09-13  2658  struct timespec64 inode_set_ctime_current(struct inode *inode)
3cd886666ff19e Deepa Dinamani 2016-09-14  2659  {
d651d1607f22fd Arnd Bergmann  2018-12-05  2660  	struct timespec64 now;
6190d23e434516 Jeff Layton    2024-09-13  2661  	u32 cns, cur;
6190d23e434516 Jeff Layton    2024-09-13  2662  	u64 cookie;
d651d1607f22fd Arnd Bergmann  2018-12-05  2663  
6190d23e434516 Jeff Layton    2024-09-13  2664  	cookie = ktime_get_coarse_real_ts64_mg(&now);
6190d23e434516 Jeff Layton    2024-09-13  2665  
6190d23e434516 Jeff Layton    2024-09-13  2666  	/* Just return that if this is not a multigrain fs */
6190d23e434516 Jeff Layton    2024-09-13  2667  	if (!is_mgtime(inode)) {
6190d23e434516 Jeff Layton    2024-09-13  2668  		now = timestamp_truncate(now, inode);
6190d23e434516 Jeff Layton    2024-09-13  2669  		inode_set_ctime_to_ts(inode, now);
6190d23e434516 Jeff Layton    2024-09-13  2670  		goto out;
3cd886666ff19e Deepa Dinamani 2016-09-14  2671  	}
3cd886666ff19e Deepa Dinamani 2016-09-14  2672  
6190d23e434516 Jeff Layton    2024-09-13  2673  	/*
6190d23e434516 Jeff Layton    2024-09-13  2674  	 * We only need a fine-grained time if someone has queried it,
6190d23e434516 Jeff Layton    2024-09-13  2675  	 * and the current coarse grained time isn't later than what's
6190d23e434516 Jeff Layton    2024-09-13  2676  	 * already there.
9b6304c1d53745 Jeff Layton    2023-07-05  2677  	 */
6190d23e434516 Jeff Layton    2024-09-13  2678  	cns = smp_load_acquire(&inode->i_ctime_nsec);
6190d23e434516 Jeff Layton    2024-09-13  2679  	if (cns & I_CTIME_QUERIED) {
6190d23e434516 Jeff Layton    2024-09-13  2680  		struct timespec64 ctime = { .tv_sec = inode->i_ctime_sec,
6190d23e434516 Jeff Layton    2024-09-13  2681  					    .tv_nsec = cns & ~I_CTIME_QUERIED };
9b6304c1d53745 Jeff Layton    2023-07-05  2682  
6190d23e434516 Jeff Layton    2024-09-13  2683  		if (timespec64_compare(&now, &ctime) <= 0)
6190d23e434516 Jeff Layton    2024-09-13  2684  			ktime_get_real_ts64_mg(&now, cookie);
6190d23e434516 Jeff Layton    2024-09-13  2685  	}
6190d23e434516 Jeff Layton    2024-09-13  2686  	now = timestamp_truncate(now, inode);
6190d23e434516 Jeff Layton    2024-09-13  2687  
6190d23e434516 Jeff Layton    2024-09-13  2688  	/* No need to cmpxchg if it's exactly the same */
6190d23e434516 Jeff Layton    2024-09-13 @2689  	if (cns == now.tv_nsec && inode->i_ctime_sec == now.tv_sec)
b5f00a1efab06a Jeff Layton    2024-09-13  2690  		trace_ctime_xchg_skip(inode, &now);
6190d23e434516 Jeff Layton    2024-09-13  2691  		goto out;
6190d23e434516 Jeff Layton    2024-09-13  2692  	cur = cns;
6190d23e434516 Jeff Layton    2024-09-13  2693  retry:
6190d23e434516 Jeff Layton    2024-09-13  2694  	/* Try to swap the nsec value into place. */
6190d23e434516 Jeff Layton    2024-09-13  2695  	if (try_cmpxchg(&inode->i_ctime_nsec, &cur, now.tv_nsec)) {
6190d23e434516 Jeff Layton    2024-09-13  2696  		/* If swap occurred, then we're (mostly) done */
6190d23e434516 Jeff Layton    2024-09-13  2697  		inode->i_ctime_sec = now.tv_sec;
b5f00a1efab06a Jeff Layton    2024-09-13  2698  		trace_ctime_ns_xchg(inode, cns, now.tv_nsec, cur);
6190d23e434516 Jeff Layton    2024-09-13  2699  	} else {
6190d23e434516 Jeff Layton    2024-09-13  2700  		/*
6190d23e434516 Jeff Layton    2024-09-13  2701  		 * Was the change due to someone marking the old ctime QUERIED?
6190d23e434516 Jeff Layton    2024-09-13  2702  		 * If so then retry the swap. This can only happen once since
6190d23e434516 Jeff Layton    2024-09-13  2703  		 * the only way to clear I_CTIME_QUERIED is to stamp the inode
6190d23e434516 Jeff Layton    2024-09-13  2704  		 * with a new ctime.
6190d23e434516 Jeff Layton    2024-09-13  2705  		 */
6190d23e434516 Jeff Layton    2024-09-13  2706  		if (!(cns & I_CTIME_QUERIED) && (cns | I_CTIME_QUERIED) == cur) {
6190d23e434516 Jeff Layton    2024-09-13  2707  			cns = cur;
6190d23e434516 Jeff Layton    2024-09-13  2708  			goto retry;
6190d23e434516 Jeff Layton    2024-09-13  2709  		}
6190d23e434516 Jeff Layton    2024-09-13  2710  		/* Otherwise, keep the existing ctime */
6190d23e434516 Jeff Layton    2024-09-13  2711  		now.tv_sec = inode->i_ctime_sec;
6190d23e434516 Jeff Layton    2024-09-13  2712  		now.tv_nsec = cur & ~I_CTIME_QUERIED;
6190d23e434516 Jeff Layton    2024-09-13  2713  	}
6190d23e434516 Jeff Layton    2024-09-13  2714  out:
9b6304c1d53745 Jeff Layton    2023-07-05  2715  	return now;
9b6304c1d53745 Jeff Layton    2023-07-05  2716  }
9b6304c1d53745 Jeff Layton    2023-07-05  2717  EXPORT_SYMBOL(inode_set_ctime_current);
2b3416ceff5e6b Yang Xu        2022-07-14  2718  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  parent reply	other threads:[~2024-09-13 20:11 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-13 13:54 [PATCH v7 00/11] fs: multigrain timestamp redux Jeff Layton
2024-09-13 13:54 ` [PATCH v7 01/11] timekeeping: move multigrain timestamp floor handling into timekeeper Jeff Layton
2024-09-13 18:59   ` John Stultz
2024-09-13 19:05     ` John Stultz
2024-09-13 19:06     ` Jeff Layton
2024-09-13 19:17       ` John Stultz
2024-09-13 13:54 ` [PATCH v7 02/11] fs: add infrastructure for multigrain timestamps Jeff Layton
2024-09-13 13:54 ` [PATCH v7 03/11] fs: have setattr_copy handle multigrain timestamps appropriately Jeff Layton
2024-09-13 13:54 ` [PATCH v7 04/11] fs: handle delegated timestamps in setattr_copy_mgtime Jeff Layton
2024-09-13 13:54 ` [PATCH v7 05/11] fs: tracepoints around multigrain timestamp events Jeff Layton
2024-09-13 14:02   ` Jeff Layton
2024-09-13 19:59   ` kernel test robot
2024-09-13 20:10   ` kernel test robot [this message]
2024-09-13 13:54 ` [PATCH v7 06/11] fs: add percpu counters for significant " Jeff Layton
2024-09-13 13:54 ` [PATCH v7 07/11] Documentation: add a new file documenting multigrain timestamps Jeff Layton
2024-09-13 13:54 ` [PATCH v7 08/11] xfs: switch to " Jeff Layton
2024-09-13 13:54 ` [PATCH v7 09/11] ext4: " Jeff Layton
2024-09-13 13:54 ` [PATCH v7 10/11] btrfs: convert " Jeff Layton
2024-09-13 13:54 ` [PATCH v7 11/11] tmpfs: add support for " Jeff Layton
2024-09-14 13:29 ` [PATCH v7 00/11] fs: multigrain timestamp redux Christian Brauner
2024-09-14 13:37   ` Jeff Layton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202409140441.OVFZpmM3-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=jlayton@kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.