From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-il1-f197.google.com (mail-il1-f197.google.com [209.85.166.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 523B0208A7 for ; Thu, 19 Dec 2024 02:57:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.197 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734577021; cv=none; b=AWVBvdDD4SrjcIkKJjw4DQQFXW9gXIu4RhA4+q40UEwAxUxSqZNv+1Qm131koB4YfR4nOo7FfSNsNzsh0xcJd3jEVlXbk9P6OixcqVE2M+fnHOI9QPl1EP8/BpCxTBQAcRhWip47A4yUhpe44aD1iYfeIws86GX++R3P2bt9qmM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734577021; c=relaxed/simple; bh=u3n91Z+9dM7os5XWvBGU3aKtDj+AYiRIFH1lX2PphCs=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=iFkZ6oepvHZfqi3sH8umYPSuurmJ4HPRrj0KH5i9uQ9WoIJxT3gdNyy/NGXeOjztxC/RPj+8vFbmUiztAzLs32yFC2JldzrUa5yRV+gWNJiQNyAtAb67gV6n/StzWELKzc5T1w6DUstYOSRJZWLlc0CW70sGigw0U1EFt23V/y4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.166.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-il1-f197.google.com with SMTP id e9e14a558f8ab-3a7e39b48a2so6805315ab.0 for ; Wed, 18 Dec 2024 18:57:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734577019; x=1735181819; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ctHb/O087awsx1d52bOdlWJymMKDmKHruv0ZeaO0plk=; b=ejjzEMWy70ySOlcA0+qKwhAYl5DVz1+XOOv/McL9qoPybwBe+QE7JXLDNbYx7aJIBc FCg9qWi48pBIrN2MuXB9JweaqBTUm4dbzeCCl8vorkiCzH6dd1rHQDpigUfkUk4tmDds +6p3kpN5p3BI0YDaztOtwNV/b4dXNaxHIQnwalIvHuV4p6MZ7Iortc12JKmg0ASmIvHk T5mmIAs1nwCLlFFYQo/S3OtZw42am/zy1OY8qPDao+69DLQ1aDnqcoFMgXNYYBAjvIg2 CWkFyzrZq4KxJUQTo7Bdhb8gHPhH1Ejd4zuNzbTcWuIA2jZX8oHttxL3+RYnFI5WmQnV rZ4g== X-Gm-Message-State: AOJu0YwurIsUopx13ZFunW9m8mQGqSmvqNHo0eHe+1oEtWFd6UdD4a23 Pu4j4kwn+FUlw4WxzIxeeSWlzEK/Zsb27TjT9HLG01mMq1NnCufc1epTp3vmL7mF16dKtPynfaN Zn0HuU+TgWyjw8lVqOop1ulvlPkyQbSY65y7QKTx+tkWka/cF/cHHAQc= X-Google-Smtp-Source: AGHT+IH5BPo8Zy8NWnfd22aePcPrcS6jSgdkiojGm1jmB0Brg6QN4wYQ/Q2mCGJGnVZe30Y1XXTsl2Dsp6ICtJKtSQC9pE7KKzKK Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6e02:1c49:b0:3a7:6e97:9877 with SMTP id e9e14a558f8ab-3c01498b9damr16982935ab.24.1734577019550; Wed, 18 Dec 2024 18:56:59 -0800 (PST) Date: Wed, 18 Dec 2024 18:56:59 -0800 In-Reply-To: <673f2511.050a0220.3c9d61.016e.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <67638b7b.050a0220.15da49.0003.GAE@google.com> Subject: Re: [syzbot] Re: [syzbot] [jfs?] possible deadlock in diFree (2) From: syzbot To: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org. *** Subject: Re: [syzbot] [jfs?] possible deadlock in diFree (2) Author: lizhi.xu@windriver.com In following calltrace, diAlloc and diFree need to hold same ag lock, so before calling duplicateIXtree(), we maybe unlock it, and relock it after. diAlloc()-> diAllocAG()-> diAllocExt()-> diNewIAG()-> duplicateIXtree()-> diFreeSpecial()-> evict()-> jfs_evict_inode()-> diFree() #syz test diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c index a360b24ed320..1f47c6e5456b 100644 --- a/fs/jfs/jfs_imap.c +++ b/fs/jfs/jfs_imap.c @@ -2594,7 +2594,9 @@ diNewIAG(struct inomap * imap, int *iagnop, int agno, struct metapage ** mpp) txEnd(tid); mutex_unlock(&JFS_IP(ipimap)->commit_mutex); + AG_UNLOCK(imap, agno); duplicateIXtree(sb, blkno, xlen, &xaddr); + AG_LOCK(imap, agno); /* update the next available iag number */ imap->im_nextiag += 1;