From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F259EB64DD for ; Fri, 21 Jul 2023 07:04:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230010AbjGUHEY (ORCPT ); Fri, 21 Jul 2023 03:04:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229846AbjGUHEX (ORCPT ); Fri, 21 Jul 2023 03:04:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E500270B for ; Fri, 21 Jul 2023 00:04:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BF4F061376 for ; Fri, 21 Jul 2023 07:04:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98FEDC433C7; Fri, 21 Jul 2023 07:04:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1689923061; bh=HQeCSqyJH9J7dDyqNzmokO+JUxVajhHq8IabxtbMquA=; h=Subject:To:Cc:From:Date:From; b=Pf/XwF1b+zDpxmJQnQRw4Th2qF+RHaSbAt+0L3JcmGLkWcCh7rH+msln6MEY4QuqZ dUUVkWGUe+ajurzJk+T/xsoxVbKvXCcFTignYiu4a6IfRJFLqJPeqG0AZrWRpY5g3a SWaI41CjJo9pwi68ZMzyDtB9f4pHz9fH0UP0oing= Subject: FAILED: patch "[PATCH] fs: dlm: make F_SETLK use unkillable wait_event" failed to apply to 4.14-stable tree To: aahringo@redhat.com, teigland@redhat.com Cc: From: Date: Fri, 21 Jul 2023 09:04:07 +0200 Message-ID: <2023072107-badass-icky-d7c8@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.14-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-4.14.y git checkout FETCH_HEAD git cherry-pick -x 0f2b1cb89ccdbdcedf7143f4153a4da700a05f48 # git commit -s git send-email --to '' --in-reply-to '2023072107-badass-icky-d7c8@gregkh' --subject-prefix 'PATCH 4.14.y' HEAD^.. Possible dependencies: 0f2b1cb89ccd ("fs: dlm: make F_SETLK use unkillable wait_event") 59e45c758ca1 ("fs: dlm: interrupt posix locks only when process is killed") c847f4e20304 ("fs: dlm: fix cleanup pending ops when interrupted") b92a4e3f86b1 ("fs: dlm: change posix lock sigint handling") 4d413ae9ced4 ("fs: dlm: use dlm_plock_info for do_unlock_close") ea06d4cabf52 ("fs: dlm: change plock interrupted message to debug again") 19d7ca051d30 ("fs: dlm: add pid to debug log") dc1acd5c9469 ("dlm: replace usage of found with dedicated list iterator variable") bcfad4265ced ("dlm: improve plock logging if interrupted") a800ba77fd28 ("dlm: rearrange async condition return") bcbb4ba6c9ba ("dlm: cleanup plock_op vs plock_xop") a559790caa1c ("dlm: replace sanity checks with WARN_ON") 42252d0d2aa9 ("dlm: fix plock invalid read") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 0f2b1cb89ccdbdcedf7143f4153a4da700a05f48 Mon Sep 17 00:00:00 2001 From: Alexander Aring Date: Fri, 19 May 2023 11:21:27 -0400 Subject: [PATCH] fs: dlm: make F_SETLK use unkillable wait_event While a non-waiting posix lock request (F_SETLK) is waiting for user space processing (in dlm_controld), wait for that processing to complete with an unkillable wait_event(). This makes F_SETLK behave the same way for F_RDLCK, F_WRLCK and F_UNLCK. F_SETLKW continues to use wait_event_killable(). Cc: stable@vger.kernel.org Signed-off-by: Alexander Aring Signed-off-by: David Teigland diff --git a/fs/dlm/plock.c b/fs/dlm/plock.c index 31bc601ee3d8..c9e1d5f54194 100644 --- a/fs/dlm/plock.c +++ b/fs/dlm/plock.c @@ -155,25 +155,29 @@ int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file, send_op(op); - rv = wait_event_killable(recv_wq, (op->done != 0)); - if (rv == -ERESTARTSYS) { - spin_lock(&ops_lock); - /* recheck under ops_lock if we got a done != 0, - * if so this interrupt case should be ignored - */ - if (op->done != 0) { + if (op->info.wait) { + rv = wait_event_killable(recv_wq, (op->done != 0)); + if (rv == -ERESTARTSYS) { + spin_lock(&ops_lock); + /* recheck under ops_lock if we got a done != 0, + * if so this interrupt case should be ignored + */ + if (op->done != 0) { + spin_unlock(&ops_lock); + goto do_lock_wait; + } + list_del(&op->list); spin_unlock(&ops_lock); - goto do_lock_wait; - } - list_del(&op->list); - spin_unlock(&ops_lock); - log_debug(ls, "%s: wait interrupted %x %llx pid %d", - __func__, ls->ls_global_id, - (unsigned long long)number, op->info.pid); - do_unlock_close(&op->info); - dlm_release_plock_op(op); - goto out; + log_debug(ls, "%s: wait interrupted %x %llx pid %d", + __func__, ls->ls_global_id, + (unsigned long long)number, op->info.pid); + do_unlock_close(&op->info); + dlm_release_plock_op(op); + goto out; + } + } else { + wait_event(recv_wq, (op->done != 0)); } do_lock_wait: