From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-io1-f71.google.com (mail-io1-f71.google.com [209.85.166.71]) (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 9E4BE21D586 for ; Thu, 19 Dec 2024 08:52:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.71 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734598368; cv=none; b=IXWs7rwvODD4N7ItaeRu/I/Q4AHcyRuC2q59ojN/8k3vmX014Mlaxx3+R0VBbFZgUcxJN0cHZje8SvYHZ6/ki7ATZP81eeQ+emhaCZRavTJEjX5N8Ipi54/9eAxfHrG697URi78QrlkaJ1VM0V+okxnUPZ3YRhUALA62UdAk1HQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734598368; c=relaxed/simple; bh=+N7OH2YDXzFEPmySwnHtzgzDWthuZwpqFaL9dd3w7Dk=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=KsYemyv0A80PGgvtY8P1mpdoPaiapFJ6KppI7GLH05aGQsmXUYs52R2d3rfyjx59vsylZlPu/4L72/Rn08QbOcIqHbnlpJcnvIjlQmFw6wy3aDDbNfQok+zPTn77acR64Pz8P7wOgyia+RoScWeMKjZSljGLXoJvs/WvRhQsTFc= 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.71 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-io1-f71.google.com with SMTP id ca18e2360f4ac-844e9b9233eso46687639f.2 for ; Thu, 19 Dec 2024 00:52:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734598365; x=1735203165; 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=uV+GPCqRWZhM0gZ3pkXbfUX/hNZV917g0Ml4JNFLKvQ=; b=iiuauKhTgymJW2oxJM5Qe6QZ94260S9r/FwCKhDYNMyu3NnB3eNu1FkJ7NM8NfCBk+ JdmP/4B7T1zTrS6GJAxhJGYrOF+/DNBeQjL9pi35lApB96o1BopQrDRkY8CfhZpsKVfV fzn6i6uRIAIHNOrRkBXXWxeq22L6z80sTTQVHpRT4pb9gj0UcCw5fFKXKZxcm7/kyE0i gwKcTR5/dR2x0VMwsYAvW1aazXNhZkV8qnqAJgOs56dqqXtQuP/hnSjAbPNHs4IuQfZg F9cfKyP0P9vWvGEiWVY31lwgjuo8x8YyttkxF6mHBRy8BkUzVRWK8P0rF39L7N3paCJ/ p7zg== X-Gm-Message-State: AOJu0YwL+EQASr6gotxO2qFWJZ2sAr5BRIp+XwlZfKqdvHITy+VdS0OL YHeqKxzn4KB+zDHElcAiMHguQMayL1Aq+E02loLkjiKgrDC/17PuwqBU1Y4MsElmLlYZn0Rtk/X 9MGkL0F0GV77aDIhvH9Ue/0a85b8M5RzOY+53Tu5OJLu3jTU2rP3C1E8= X-Google-Smtp-Source: AGHT+IFXkJAFnOWkKxTTM3p7Vo/0awLb27RbHW4t7ewjVxHjRGv+lO7bLxv3XsF2gY6bniKwGPWeETwEOITeLTvjkIjfOeoJ7Odh 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:2164:b0:3a7:7811:1101 with SMTP id e9e14a558f8ab-3c015050f50mr25518255ab.20.1734598365675; Thu, 19 Dec 2024 00:52:45 -0800 (PST) Date: Thu, 19 Dec 2024 00:52: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: <6763dedd.050a0220.15da49.0008.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..9f105c748447 100644 --- a/fs/jfs/jfs_imap.c +++ b/fs/jfs/jfs_imap.c @@ -2594,7 +2594,13 @@ diNewIAG(struct inomap * imap, int *iagnop, int agno, struct metapage ** mpp) txEnd(tid); mutex_unlock(&JFS_IP(ipimap)->commit_mutex); + IWRITE_UNLOCK(ipimap); + IAGFREE_UNLOCK(imap); + AG_UNLOCK(imap, agno); duplicateIXtree(sb, blkno, xlen, &xaddr); + AG_LOCK(imap, agno); + IAGFREE_LOCK(imap); + IWRITE_LOCK(ipimap, RDWRLOCK_IMAP); /* update the next available iag number */ imap->im_nextiag += 1;