From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-il1-f198.google.com (mail-il1-f198.google.com [209.85.166.198]) (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 74C0221CA11 for ; Thu, 19 Dec 2024 08:24:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.198 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734596687; cv=none; b=rEq/1b4l26Sv1RDFvtoTUDvEYDdi7199bUcwT7X/55pVGYS4eag7rLoWvKSnr1gIZp0B/LnF9N4BpE/jNdjnYrUWS7xMykB5n0AC9zUsSnqmv3lqc/sIWhDoOeekfnlB8mV3XfIo1jv4XkDyCgwlKL8h7KHVD403KN/P+45sgUM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734596687; c=relaxed/simple; bh=rlDvIj/3u3WH2bO9SR657omc85sbIocEG0fOvnFelJs=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=QhC6qAolgLdaER/4+vmLH1QHmtzu3Y86/WhLL5GbD6jgsKpSaogjxRWLxYXpn+wcHq35F1PsjVvYzDcVuxJejUA8GqAWahuXKCXwtx7ysK0+3LRlibQdQzu2nxPIzOmOpXlL8l8Alog3q8L7sAX8DeW/VgVdnj3D56uWwSMaUJk= 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.198 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-f198.google.com with SMTP id e9e14a558f8ab-3a9cd0b54c1so4089715ab.0 for ; Thu, 19 Dec 2024 00:24:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734596685; x=1735201485; 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=eKkOYIqnYqR41LLft9omGlwCOSzsdhpp9ITqVW38HgM=; b=eO37vrhuuLZ3m883mwSc0b+3ClIO8iBNjWxj+IFPRWshz/83U1TAhv8leKuXmN75vx 2wWdTb9UIVs9pTrEKeWOJh2Npm4WOHjf7mzegAZyITDXfLh6pgjlmPBFN05EUK8XLx0l k+kTETKdl5Bxm4bKdA0oZ8tD9WrGTN7/GdVT4Og7gQsN2EA5PKDVUDwX8g4wjnzUESQs ulu1mGE0Eih7yt2+1/1KXslf6LhCpvkR1kWZbIeK650RNu8KJ6yyHVZKoYicJXd+8du6 b737w+tS7cFYxHVUkfgD3uXhOYf1TC+UyGbSQz/FqCAg3gg9/BoLdOxeX90uoecJS2HT msHQ== X-Gm-Message-State: AOJu0YxyMMX1T0yuhcnfMml/65qFM/Ua1/zK35HWqd1IGLJkCz24eFwj W2CyWkkNziRqaisn1XE6RV03fMYIt/ieKKF9dzxI5HagTWOHIhUNLPaXzvyQh+YNXGE2dvtL88Y V0H5eYX5zYE3U1xdawjumf7fHDFQkmkR/zu8ljyravl5h+nFt9rYz03k= X-Google-Smtp-Source: AGHT+IGttPglpD3t+/Zzq3KZ7DhQX5FeTqB5LlQiUySEXr5j/cu7QPP83Gdp0XIFe/Zx6EvV3bebDYfpbYFG8foK6e6uinRhUdKR 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:144f:b0:3a7:a4ec:6cfc with SMTP id e9e14a558f8ab-3c011b45ba1mr20285925ab.8.1734596685274; Thu, 19 Dec 2024 00:24:45 -0800 (PST) Date: Thu, 19 Dec 2024 00:24:45 -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: <6763d84d.050a0220.3157ee.0012.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..ca25ff57c48a 100644 --- a/fs/jfs/jfs_imap.c +++ b/fs/jfs/jfs_imap.c @@ -2594,7 +2594,11 @@ diNewIAG(struct inomap * imap, int *iagnop, int agno, struct metapage ** mpp) txEnd(tid); mutex_unlock(&JFS_IP(ipimap)->commit_mutex); + IWRITE_UNLOCK(ipimap); + AG_UNLOCK(imap, agno); duplicateIXtree(sb, blkno, xlen, &xaddr); + AG_LOCK(imap, agno); + IWRITE_LOCK(ipimap, RDWRLOCK_IMAP); /* update the next available iag number */ imap->im_nextiag += 1;