From patchwork Fri Jun 28 18:09:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Connor Kuehl X-Patchwork-Id: 1124419 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45b4c86Zrdz9s3Z; Sat, 29 Jun 2019 04:12:22 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1hgvM6-0005PL-6A; Fri, 28 Jun 2019 18:12:14 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1hgvM4-0005PF-EW for kernel-team@lists.ubuntu.com; Fri, 28 Jun 2019 18:12:12 +0000 Received: from mail-pf1-f198.google.com ([209.85.210.198]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1hgvJq-0001vW-8l for kernel-team@lists.ubuntu.com; Fri, 28 Jun 2019 18:09:54 +0000 Received: by mail-pf1-f198.google.com with SMTP id 145so4365484pfv.18 for ; Fri, 28 Jun 2019 11:09:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language; bh=KgoEvWwxBs9zdiKKQ7IVIFhNVvrYWT2rJfnvyGLTIL8=; b=heE9sae0ENNc1SAq3+Ln7usW7FHciGrSU1gk3Im4I9gSU8QuS38+S9YkMtP6MZ/nUk aGCNnXAeptaYBXTUtMzkjNQ/B59Y/Op0zeGgJvFZNU6oKMRJn7JShLzwSvs6yInjaGLO y5euFnvR8Nfo5HuBXuPwoyW1XkG+UCtYejZOG6qxvgGl1UPpQkkbjptFbqkfV2YwR4T8 y7kr9ySXOIW96K+tMU0mEmnxbyAgHFGk3AyJyO0AwZIkz47T0wlcwmGRyECkcL/TX8OB QqfZ8hc2Ggy7XJHso6i49XUtl1BM4v7HRFqpOBRY7m09xanOPh8BrEcmlNIM4fLYcM6B PZFA== X-Gm-Message-State: APjAAAUHpFVB9u06Ewoq2xXyacIIgZD7arNcJbQP8L8uS/W4stLQshAJ KMwGODD/4mAybNFTWeJRyK8icAdG7mDZneB2GKS71Tvj2KA4Rh510MqgnQWb6Olxtq3WPldds95 +CwIH7gxlCntMKWSqhWKsPgpVmYho/idSIBgrcuLhTw== X-Received: by 2002:a17:90a:208d:: with SMTP id f13mr14309410pjg.68.1561745392614; Fri, 28 Jun 2019 11:09:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqz7RSXKjWvsLEzgkgq5E6PdjaVKLcEhMfHGRpiJrDBy9wV1avuue5sEr2SuyiiztyqpaebMhA== X-Received: by 2002:a17:90a:208d:: with SMTP id f13mr14309384pjg.68.1561745392328; Fri, 28 Jun 2019 11:09:52 -0700 (PDT) Received: from [192.168.0.147] (c-71-63-131-226.hsd1.or.comcast.net. [71.63.131.226]) by smtp.gmail.com with ESMTPSA id d6sm2431103pjo.32.2019.06.28.11.09.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Jun 2019 11:09:51 -0700 (PDT) To: kernel-team@lists.ubuntu.com From: Connor Kuehl Subject: [SRU][Pull][Bionic] Fix deadlock in ceph Message-ID: Date: Fri, 28 Jun 2019 11:09:49 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 MIME-Version: 1.0 Content-Language: en-US X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1834235 [Impact] Deadlock may occur if iput_final() decides to wait for readahead pages while a lock is held. In order to resolve this, the following two patches install an asynchronous "iput" for the ceph inodes so that a hold-and-wait deadlock doesn't occur. A more detailed example is shown in the original patch: https://github.com/ceph/ceph-client/commit/093ea205acd4b047cf5aacabc0c6ffecf198d2a9 Requested patches: 3e1d0452edcee ceph: avoid iput_final() while holding mutex or in dispatch thread 1cf89a8dee5e6 ceph: single workqueue for inode related works [Test Case] These changes were tested by the original requester with positive results over a few days in their own environment where they first experienced the regression. They have determined they are no longer experiencing the regression with this patch set applied to a test kernel. [Regression Potential] Several patches were required in order to cleanly cherry pick the requested patches. A large number of changes increases the regression potential, however, these pre-requisite patches have been in mainline since early 2018 and the blast radius is localized only to ceph. ---------------------------------------------------------------- The following changes since commit bb936a8a0dbbc727533e953071862a228044fa9f: block/bio: Do not zero user pages (2019-06-28 18:27:34 +0200) are available in the Git repository at: git+ssh://connork@git.launchpad.net/~connork/+git/bionic ceph for you to fetch changes up to 4a7619c37800ae7433f2bd5e2d66ce4a3c60d23e: ceph: avoid iput_final() while holding mutex or in dispatch thread (2019-06-28 09:32:06 -0700) ---------------------------------------------------------------- Luis Henriques (6): ceph: quota: add initial infrastructure to support cephfs quotas ceph: quota: support for ceph.quota.max_files ceph: quota: don't allow cross-quota renames ceph: quota: support for ceph.quota.max_bytes ceph: quota: update MDS when max_bytes is approaching ceph: quota: add counter for snaprealms with quota Yan, Zheng (8): ceph: use atomic_t for ceph_inode_info::i_shared_gen ceph: define argument structure for handle_cap_grant ceph: flush pending works before shutdown super ceph: send cap releases more aggressively ceph: single workqueue for inode related works ceph: avoid dereferencing invalid pointer during cached readdir ceph: fix root quota realm check ceph: avoid iput_final() while holding mutex or in dispatch thread Documentation/filesystems/ceph.txt | 12 ++ fs/ceph/Makefile | 2 +- fs/ceph/caps.c | 154 ++++++++++--------- fs/ceph/dir.c | 75 +++++++--- fs/ceph/file.c | 23 ++- fs/ceph/inode.c | 211 ++++++++++++++++---------- fs/ceph/mds_client.c | 113 +++++++++++--- fs/ceph/mds_client.h | 14 +- fs/ceph/quota.c | 298 +++++++++++++++++++++++++++++++++++++ fs/ceph/snap.c | 16 +- fs/ceph/super.c | 38 ++--- fs/ceph/super.h | 62 ++++++-- fs/ceph/xattr.c | 44 ++++++ include/linux/ceph/ceph_features.h | 1 + include/linux/ceph/ceph_fs.h | 17 +++ net/ceph/ceph_common.c | 1 + 16 files changed, 847 insertions(+), 234 deletions(-) create mode 100644 fs/ceph/quota.c Acked-by: Kleber Sacilotto de Souza Acked-by: Stefan Bader