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 X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8EF5EC4360C for ; Thu, 26 Sep 2019 19:52:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 66A07222C3 for ; Thu, 26 Sep 2019 19:52:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728699AbfIZTwj (ORCPT ); Thu, 26 Sep 2019 15:52:39 -0400 Received: from mx2.suse.de ([195.135.220.15]:49998 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728643AbfIZTwj (ORCPT ); Thu, 26 Sep 2019 15:52:39 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 0F75EB136; Thu, 26 Sep 2019 19:52:38 +0000 (UTC) Date: Thu, 26 Sep 2019 14:52:34 -0500 From: Goldwyn Rodrigues To: viro@zeniv.linux.org.uk Cc: autofs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [RFC] Don't propagate automount Message-ID: <20190926195234.bipqpw5sbk5ojcna@fiona> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: NeoMutt/20180716 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org An access to automounted filesystem can deadlock if it is a bind mount on shared mounts. A user program should not deadlock the kernel while automount waits for propagation of the mount. This is explained at https://bugzilla.redhat.com/show_bug.cgi?id=1358887#c10 I am not sure completely blocking automount is the best solution, so please reply with what is the best course of action to do in such a situation. Propagation of dentry with DCACHE_NEED_AUTOMOUNT can lead to propagation of mount points without automount maps and not under automount control. So, do not propagate them. Signed-off-by: Goldwyn Rodrigues diff --git a/fs/pnode.c b/fs/pnode.c index 49f6d7ff2139..b960805d7954 100644 --- a/fs/pnode.c +++ b/fs/pnode.c @@ -292,6 +292,9 @@ int propagate_mnt(struct mount *dest_mnt, struct mountpoint *dest_mp, struct mount *m, *n; int ret = 0; + if (source_mnt->mnt_mountpoint->d_flags & DCACHE_NEED_AUTOMOUNT) + return 0; + /* * we don't want to bother passing tons of arguments to * propagate_one(); everything is serialized by namespace_sem, -- Goldwyn