linux-fscrypt.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Eric Biggers <ebiggers@kernel.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	"Theodore Y. Ts'o" <tytso@mit.edu>,
	Suleiman Souhlal <suleiman@google.com>,
	linux-fscrypt@vger.kernel.org, stable@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [stable] ext4 fscrypt_get_encryption_info() circular locking dependency
Date: Fri, 11 Dec 2020 13:08:07 +0900	[thread overview]
Message-ID: <20201211040807.GF1667627@google.com> (raw)
In-Reply-To: <X9LsDPsXdLNv0+va@sol.localdomain>

On (20/12/10 19:48), Eric Biggers wrote:
> > 
> > [  133.454836] Chain exists of:
> >                  jbd2_handle --> fscrypt_init_mutex --> fs_reclaim
> > 
> > [  133.454840]  Possible unsafe locking scenario:
> > 
> > [  133.454841]        CPU0                    CPU1
> > [  133.454843]        ----                    ----
> > [  133.454844]   lock(fs_reclaim);
> > [  133.454846]                                lock(fscrypt_init_mutex);
> > [  133.454848]                                lock(fs_reclaim);
> > [  133.454850]   lock(jbd2_handle);
> > [  133.454851] 
> 
> This actually got fixed by the patch series
> https://lkml.kernel.org/linux-fscrypt/20200913083620.170627-1-ebiggers@kernel.org/
> which went into 5.10.  The more recent patch to remove ext4_dir_open() isn't
> related.
> 
> It's a hard patch series to backport.  Backporting it to 5.4 would be somewhat
> feasible, while 4.19 would be very difficult as there have been a lot of other
> fscrypt commits which would heavily conflict with cherry-picks.
> 
> How interested are you in having this fixed?  Did you encounter an actual
> deadlock or just the lockdep report?

Difficult to say. On one hand 'yes' I see lockups on my devices (4.19
kernel); I can't tell at the moment what's the root cause. So on the
other hand 'no' I can't say that it's because of ext4_dir_open().

What I saw so far involved ext4, kswapd, khugepaged and lots of other things.

[ 1598.655901] INFO: task khugepaged:66 blocked for more than 122 seconds.
[ 1598.655914] Call Trace:
[ 1598.655920]  __schedule+0x506/0x1240
[ 1598.655924]  ? kvm_zap_rmapp+0x52/0x69
[ 1598.655927]  schedule+0x3f/0x78
[ 1598.655929]  __rwsem_down_read_failed_common+0x186/0x201
[ 1598.655933]  call_rwsem_down_read_failed+0x14/0x30
[ 1598.655936]  down_read+0x2e/0x45
[ 1598.655939]  rmap_walk_file+0x73/0x1ce
[ 1598.655941]  page_referenced+0x10d/0x154
[ 1598.655948]  shrink_active_list+0x1d4/0x475

[..]

[ 1598.655986] INFO: task kswapd0:79 blocked for more than 122 seconds.
[ 1598.655993] Call Trace:
[ 1598.655995]  __schedule+0x506/0x1240
[ 1598.655998]  schedule+0x3f/0x78
[ 1598.656000]  __rwsem_down_read_failed_common+0x186/0x201
[ 1598.656003]  call_rwsem_down_read_failed+0x14/0x30
[ 1598.656006]  down_read+0x2e/0x45
[ 1598.656008]  rmap_walk_file+0x73/0x1ce
[ 1598.656010]  page_referenced+0x10d/0x154
[ 1598.656015]  shrink_active_list+0x1d4/0x475

[..]

[ 1598.658233]  __rwsem_down_read_failed_common+0x186/0x201
[ 1598.658235]  call_rwsem_down_read_failed+0x14/0x30
[ 1598.658238]  down_read+0x2e/0x45
[ 1598.658240]  rmap_walk_file+0x73/0x1ce
[ 1598.658242]  page_referenced+0x10d/0x154
[ 1598.658247]  shrink_active_list+0x1d4/0x475
[ 1598.658250]  shrink_node+0x27e/0x661
[ 1598.658254]  try_to_free_pages+0x425/0x7ec
[ 1598.658258]  __alloc_pages_nodemask+0x80b/0x1514
[ 1598.658279]  __do_page_cache_readahead+0xd4/0x1a9
[ 1598.658282]  filemap_fault+0x346/0x573
[ 1598.658287]  ext4_filemap_fault+0x31/0x44

	-ss

  reply	other threads:[~2020-12-11  4:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-11  3:36 [stable] ext4 fscrypt_get_encryption_info() circular locking dependency Sergey Senozhatsky
2020-12-11  3:48 ` Eric Biggers
2020-12-11  4:08   ` Sergey Senozhatsky [this message]
2020-12-11  4:34     ` Sergey Senozhatsky
2020-12-11 18:03     ` Eric Biggers
2021-01-13 11:34       ` Sergey Senozhatsky

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=20201211040807.GF1667627@google.com \
    --to=sergey.senozhatsky.work@gmail.com \
    --cc=ebiggers@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=suleiman@google.com \
    --cc=tytso@mit.edu \
    /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;
as well as URLs for NNTP newsgroup(s).