linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@inria.fr>
To: Andreas Gruenbacher <agruenba@redhat.com>
Cc: Linux Memory Management List <linux-mm@kvack.org>,
	 oe-kbuild-all@lists.linux.dev
Subject: [linux-next:master 9366/12162] fs/gfs2/super.c:762:0-1: preceding lock on line 738 (fwd)
Date: Sun, 25 Jun 2023 17:40:35 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2306251739540.3022@hadrien> (raw)

Please check whether an unlock is needed in the goto out case.

julia

---------- Forwarded message ----------
Date: Sun, 25 Jun 2023 23:06:48 +0800
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Julia Lawall <julia.lawall@inria.fr>
Subject: [linux-next:master 9366/12162] fs/gfs2/super.c:762:0-1: preceding lock
    on line 738

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Andreas Gruenbacher <agruenba@redhat.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   8d2be868b42c08290509c60515865f4de24ea704
commit: 4ad135d5be933a17cd07d09a77470ca169baf869 [9366/12162] gfs2: Rework freeze / thaw logic
:::::: branch date: 2 days ago
:::::: commit date: 10 days ago
config: s390-randconfig-r054-20230625 (https://download.01.org/0day-ci/archive/20230625/202306252241.Lahe2YsR-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230625/202306252241.Lahe2YsR-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>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202306252241.Lahe2YsR-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> fs/gfs2/super.c:762:0-1: preceding lock on line 738

vim +762 fs/gfs2/super.c

4ad135d5be933a Andreas Gruenbacher 2022-11-14  731
4ad135d5be933a Andreas Gruenbacher 2022-11-14  732  void gfs2_freeze_func(struct work_struct *work)
4ad135d5be933a Andreas Gruenbacher 2022-11-14  733  {
4ad135d5be933a Andreas Gruenbacher 2022-11-14  734  	struct gfs2_sbd *sdp = container_of(work, struct gfs2_sbd, sd_freeze_work);
4ad135d5be933a Andreas Gruenbacher 2022-11-14  735  	struct super_block *sb = sdp->sd_vfs;
4ad135d5be933a Andreas Gruenbacher 2022-11-14  736  	int error;
4ad135d5be933a Andreas Gruenbacher 2022-11-14  737
4ad135d5be933a Andreas Gruenbacher 2022-11-14 @738  	mutex_lock(&sdp->sd_freeze_mutex);
4ad135d5be933a Andreas Gruenbacher 2022-11-14  739  	error = -EBUSY;
4ad135d5be933a Andreas Gruenbacher 2022-11-14  740  	if (atomic_read(&sdp->sd_freeze_state) != SFS_UNFROZEN)
4ad135d5be933a Andreas Gruenbacher 2022-11-14  741  		goto out_unlock;
4ad135d5be933a Andreas Gruenbacher 2022-11-14  742
4ad135d5be933a Andreas Gruenbacher 2022-11-14  743  	error = gfs2_freeze_locally(sdp);
4ad135d5be933a Andreas Gruenbacher 2022-11-14  744  	if (error)
4ad135d5be933a Andreas Gruenbacher 2022-11-14  745  		goto out_unlock;
4ad135d5be933a Andreas Gruenbacher 2022-11-14  746
4ad135d5be933a Andreas Gruenbacher 2022-11-14  747  	gfs2_freeze_unlock(&sdp->sd_freeze_gh);
4ad135d5be933a Andreas Gruenbacher 2022-11-14  748  	atomic_set(&sdp->sd_freeze_state, SFS_FROZEN);
4ad135d5be933a Andreas Gruenbacher 2022-11-14  749
4ad135d5be933a Andreas Gruenbacher 2022-11-14  750  	error = gfs2_do_thaw(sdp);
4ad135d5be933a Andreas Gruenbacher 2022-11-14  751  	if (error)
4ad135d5be933a Andreas Gruenbacher 2022-11-14  752  		goto out;
4ad135d5be933a Andreas Gruenbacher 2022-11-14  753
4ad135d5be933a Andreas Gruenbacher 2022-11-14  754  	atomic_set(&sdp->sd_freeze_state, SFS_UNFROZEN);
4ad135d5be933a Andreas Gruenbacher 2022-11-14  755
4ad135d5be933a Andreas Gruenbacher 2022-11-14  756  out_unlock:
4ad135d5be933a Andreas Gruenbacher 2022-11-14  757  	mutex_unlock(&sdp->sd_freeze_mutex);
2e60d7683c8d2e Benjamin Marzinski  2014-11-13  758  	deactivate_super(sb);
4ad135d5be933a Andreas Gruenbacher 2022-11-14  759  out:
4ad135d5be933a Andreas Gruenbacher 2022-11-14  760  	if (error)
4ad135d5be933a Andreas Gruenbacher 2022-11-14  761  		fs_info(sdp, "GFS2: couldn't freeze filesystem: %d\n", error);
2e60d7683c8d2e Benjamin Marzinski  2014-11-13 @762  }
2e60d7683c8d2e Benjamin Marzinski  2014-11-13  763

:::::: The code at line 762 was first introduced by commit
:::::: 2e60d7683c8d2ea21317f6d9f4cd3bf5428ce162 GFS2: update freeze code to use freeze/thaw_super on all nodes

:::::: TO: Benjamin Marzinski <bmarzins@redhat.com>
:::::: CC: Steven Whitehouse <swhiteho@redhat.com>

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


                 reply	other threads:[~2023-06-25 15:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=alpine.DEB.2.22.394.2306251739540.3022@hadrien \
    --to=julia.lawall@inria.fr \
    --cc=agruenba@redhat.com \
    --cc=linux-mm@kvack.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox