[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200323153045.s7ag3lrvfe2cpiiw@e107158-lin.cambridge.arm.com>
Date: Mon, 23 Mar 2020 15:30:45 +0000
From: Qais Yousef <qais.yousef@....com>
To: Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org
Cc: linux-kernel@...r.kernel.org
Subject: Re: lockdep warning in sys_swapon
On 03/23/20 15:17, Qais Yousef wrote:
> Hi
>
> I hit the following 2 warnings when running with LOCKDEP=y on arm64 platform
> (juno-r2), running on v5.6-rc6
>
> The 1st one is when I execute `swapon -a`. The 2nd one happens at boot. I have
> /dev/sda2 as my swap in /etc/fstab
>
> Note that I either hit 1 OR 2, but didn't hit both warnings at the same time,
> yet at least.
>
> /dev/sda2 is a usb flash drive, in case it matters somehow.
By the way, I noticed that in claim_swapfile() if we fail we don't release the
lock. Shouldn't we release the lock here?
I tried with that FWIW, but it had no effect on the warnings.
diff --git a/mm/swapfile.c b/mm/swapfile.c
index b2a2e45c9a36..0293e8c7b472 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2900,8 +2900,10 @@ static int claim_swapfile(struct swap_info_struct *p, struct inode *inode)
}
inode_lock(inode);
- if (IS_SWAPFILE(inode))
+ if (IS_SWAPFILE(inode)) {
+ inode_unlock(inode);
return -EBUSY;
+ }
return 0;
}
Thanks
--
Qais Yousef
Powered by blists - more mailing lists