Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp142177lqp; Thu, 4 Apr 2024 09:03:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWUT9Ci2yVgusCd1rvHTg9XVULeJZLU52xkBLq88Qoa0eMLCGyxrfpl8hye1kw+67zMP/4hMVnKC8rexITzZcY4+SPC+WeG75TNg4itSw== X-Google-Smtp-Source: AGHT+IHHbKMdd0ciGbGw5pp8K+Ayuw3aA+jZYBrDI3PKOFvBa/Rc+QQDYHkn8qNzRd0StyKLyF63 X-Received: by 2002:a17:90a:fa98:b0:2a2:37ed:24d5 with SMTP id cu24-20020a17090afa9800b002a237ed24d5mr2951646pjb.2.1712246624033; Thu, 04 Apr 2024 09:03:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712246624; cv=pass; d=google.com; s=arc-20160816; b=dWRal9E3uZupn+H9WyxgZqyF0c/soBap1VV5fIT4IoehMabt0yW/0d4FLo37kdyssh 7uAdZ+UBN7hvaBMaPzPs7GbBO8iSDJcO5ogj/u8Vf0UZ//E4Gh77Q+QYNUnugMwYoVlr kqOpGuKLJYORXU81qqrmhqKCjxA0v6nX90/gbdUjj1tyP3hgzi1XI2Q14kLlti6+VpOW /QWC/q8zjOYGCGXe5V/jayo2B/XxuVxH4/Yy+aDKnDJ1Wj0S9F8Br6jSigJMxm+RFRIY nyRCge5kDDzME/D6OcNZGYddgHudrq+RJ4x1C8I9TDq1bAojH7oJEGolvPqXV0/SLalb H7IA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=cy0MHR54JGNOFy9o8DAySgEG/x1fzuUUOcz6G/+T/+s=; fh=1H9jniSkrkPImSH0zHpeMO/h8EpK7woev8V6XCWpfQM=; b=bR3+EKDc1E4jBjD7YR8llTmWv8jySutXI9seQdPw5v6vc1eIM6Co+DUQr5fiTqDAAF MNNgyp08AJmcEGW3K1GhtK854269AXFscnIaPKyyV2rgsugFjBSrb90+Z0xWT/Bhs/or HsHB089F7S/DH76+aojpQUaFfZEC2EufqrKxS97tqefiqvdGfwIFE909CpalqpsG2AF0 QgtvvlLa71J4ldjg0YGqfHEy3gP04OV40PaeJC10stPXA8IXOOae9N01seZ69gtjB305 XAtmduhLtyEsIbL2L1jqBZ1I9SGx8n9hny+kLPnaK7URnsWGI3VB265bHJ9tMVqpkut8 nlxg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VZFddwlR; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-ext4+bounces-1863-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1863-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id ci1-20020a17090afc8100b002a27693399dsi1901548pjb.102.2024.04.04.09.03.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 09:03:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4+bounces-1863-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VZFddwlR; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-ext4+bounces-1863-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1863-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E7C502843AC for ; Thu, 4 Apr 2024 16:03:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6BBF912AAE1; Thu, 4 Apr 2024 16:03:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VZFddwlR" X-Original-To: linux-ext4@vger.kernel.org Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (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 A428E17BA8; Thu, 4 Apr 2024 16:03:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712246608; cv=none; b=fYS1hA607QS6bTYSuZn1q+/pDd4MB/R0sgarKwWi1whz5Vf+/OOBpFxPIK9EMCWro+jU8+07OLWZwXZavfeh8RDZNCZSjhnoJTqMx+NvbTBKenkh4BK0q2wYnxe3S2t2NKmlzmNB8tYwu+IVZovzSfWaMXMeJIInLidaN4bpc1k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712246608; c=relaxed/simple; bh=3laSCnY9+DHBNm5Yb0RHMgrrQMU1Q8kYq9NMeNSgcUY=; h=Date:Message-Id:From:To:Cc:Subject:In-Reply-To; b=a2eR1njn4b2xQL5PvxNLGqfr4pgfCgGIQcRvq8XYEcCukZvgEKQHSNwtkXzT0HdGo1NyO+cere4e4/xtGSKHH0Idh4/hU7UFCbP/3s70+/v+nuvqjyjI5FSCBLGf5rwHiFbNpgiJgWmqk1K60uEL6GShthbXSr/VkXpZVYSnuzw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VZFddwlR; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1e2b137d666so6246915ad.2; Thu, 04 Apr 2024 09:03:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712246606; x=1712851406; darn=vger.kernel.org; h=in-reply-to:subject:cc:to:from:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=cy0MHR54JGNOFy9o8DAySgEG/x1fzuUUOcz6G/+T/+s=; b=VZFddwlRdAgzetcEnHreInivpE+VTNV068HzOcDUjm72PAAA2tgtjsTXLQH1QZkQj6 7HAps1aqM69WBn9fYNyyBQWE4z55750gMhI5/XoIv1KS0dYLF2L4kjElYV+0euejks4g YOLeLVSOTzDAPk+FlE3etbV7A/3UAP23VcWoiXVyudS/2K8/E4fLWOS7LF5Vloy+ks1a 3GMVOklyivNp4nt9PymcZtsnfHcZGtViOx5zrQCzboW/MaIOWF7Zd6jvPu6Dj7MoFgzb kUhDr+O2POSZOi8PIfMj1Cer8+l5my5NpVF1bzjQM9dNgVHLFMTzfJ9e2/1pH5PI+4tn PDPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712246606; x=1712851406; h=in-reply-to:subject:cc:to:from:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=cy0MHR54JGNOFy9o8DAySgEG/x1fzuUUOcz6G/+T/+s=; b=semuGKcjLj7FV2L6X8c6CJhPWWay2jOv+xD4KhrwmKO2+b4ZsevKuAtfDjKXXRhLJe YqtzBDvQ0SVdB3ywXAP3abLBlAQ8GUdu2vPzZXPCBUGEejGx1q1Pu2l87qdrphy2Xl+D TXyqNqfnSiU8x1jsewQdSxvJy2U+Pb3N8jLNiSKtyAA8Clhtbpj4MtDBdWa9XMduSy/p jSDmQox320G3Yd6u5JnpferwFBesKKf0TK55b7olWpCvyb04lbZIxgj/IIU80q/Ie6VN 1zfigzSmAkL9/a3CZ9wOmHbaYs9xgZPRAH+GyHqdJ4xa2r8n36OLzbSL7ogyo3jfafkC lRpQ== X-Forwarded-Encrypted: i=1; AJvYcCVHokn3snaM2iqzLU4CoWp1+fbt9wXyvjE7kdi2opXBh3y6QM/sO9+mNreBXm2oHs6+KTxRFsEwMv7ftpB99AO0zGtkOskEM/r2N7slidUY4B58qR8UTCxaQvinGfBoQ7ZL//pYaGPDSg== X-Gm-Message-State: AOJu0YwiPSXe3mfxkmScp8WZWSDP0HxJhbYE6kA3gDWuoAtkrpqdpUfn eCw4mkTBetU4a6nd82LqkiLEXmkntm5qlGfwmhNuKkgS32JJRPUK X-Received: by 2002:a17:902:c947:b0:1e0:a784:f965 with SMTP id i7-20020a170902c94700b001e0a784f965mr2658122pla.65.1712246605769; Thu, 04 Apr 2024 09:03:25 -0700 (PDT) Received: from dw-tp ([49.205.218.89]) by smtp.gmail.com with ESMTPSA id a21-20020a170902ee9500b001dd95b5dd0fsm15614103pld.69.2024.04.04.09.03.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 09:03:14 -0700 (PDT) Date: Thu, 04 Apr 2024 21:32:55 +0530 Message-Id: <87frw1azf4.fsf@gmail.com> From: Ritesh Harjani (IBM) To: Mikhail Ukhin , Theodore Ts'o Cc: Mikhail Ukhin , Andreas Dilger , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, Michail Ivanov , Pavel Koshutin , Artem Sadovnikov Subject: Re: [PATCH] ext4: fix semaphore unlocking order In-Reply-To: <87h6goqx9u.fsf@gmail.com> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Ritesh Harjani (IBM) writes: > Mikhail Ukhin writes: > >> Fuzzing reports a possible deadlock in jbd2_log_wait_commit. I think I agree with what Jan hinted to me in the call, that how can an unlock order mismatch be a deadlock. But yes, a wrong unlock order can increase the locking times of thread-2 waiting on lock B; for e.g. if a premption happens between unlock of lock A & B by thread-1. So it is always good to fix the unlock order too. >> >> The problem occurs in ext4_ind_migrate due to an incorrect order of >> unlocking of the journal and write semaphores - the order of unlocking >> must be the reverse of the order of locking. >> > > Maybe we should update the subject msg to: > "ext4: "fix i_data_sem unlock order in ext4_ind_migrate()" > > and also should add: > CC: stable@vger.kernel.org In that case, I am not really sure, if this requires a cc'd stable. So, I will leave this upto Ted. > > > I think this should have been fixed in patch [1], but looks like it > forgot to fix the unlock order. > > [1]: https://lore.kernel.org/all/1364801462-13120-1-git-send-email-dmonakhov@openvz.org/ > > >> Found by Linux Verification Center (linuxtesting.org) with syzkaller. It will be good to know what was the test which identified this though? -ritesh