From patchwork Thu Aug 23 02:27:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Whitney X-Patchwork-Id: 961132 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ext4-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="F1L9hTlR"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41wpGj02Zgz9s0n for ; Thu, 23 Aug 2018 12:27:40 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727313AbeHWFzB (ORCPT ); Thu, 23 Aug 2018 01:55:01 -0400 Received: from mail-yw1-f53.google.com ([209.85.161.53]:34515 "EHLO mail-yw1-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726121AbeHWFzA (ORCPT ); Thu, 23 Aug 2018 01:55:00 -0400 Received: by mail-yw1-f53.google.com with SMTP id y134-v6so1433592ywg.1 for ; Wed, 22 Aug 2018 19:27:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=2nUHK5s47kAr94kiMtcpByW5u98EgjhHI7GwU9jMq8I=; b=F1L9hTlRk5LYmwuwbqEktaTwIGgmvAIE44FUAAtJ0BWmGSlc8ABScymAi6OrRtoDsG +dZp4I9YqdEk5b2F8I+uv2ZaHTcEzOKaMF1/mTLwjTRYgt3aPGYdYnhtZsAJK12dcBPK f8Ls6lgEx9FnwjIMA7BTberToxD2vi9X7523WzN5WG4QuSQ5Ic7wOPfvIu/cxncdzXFy o26n6yxY9zHFsCwoeCwHDU+1yqBvtVSb59UYKhnurerE8fiOIy5OhFnOkKOwQ5IrxqF6 cddAtItv5AGwK0JRwfzNdOzwzIY6Ps5UBnFc6Lv1jZrWb8InPRtrOd+ap7VdEHbJ5Mh+ +ypg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=2nUHK5s47kAr94kiMtcpByW5u98EgjhHI7GwU9jMq8I=; b=GCBvYsQSzChLIDvgxS2tJDQ9zA8/hWiJ6G6FnxgmZqDumoLbELX9bWtlOkcnZst0Ed CzslLDlfssdbkktnzQHtT/pZIiQ5El56ZrB9ZpEjDWVNa1U3BFPy+p+lS3OzXNLjnHJj NkERu5IB5M4xBLm6WmNfjQRVMJ9W7+fNZ0mzJaxwCNlJSJ987CF1KfIi/lOpFA26s1Z5 sbRjOSXNMfRLU3O5woMdA2caMHUtxuK+JocMN7kgea4CCGAUy1PJgV3ehENrXESQJFXL GGaBkov9uXsrB4zQRDS7Q+hdVTCrXAR9BKVrEbYF7Ux6ZWBpHieP3yxRCQ2EWVfmt0/Z HfTg== X-Gm-Message-State: APzg51ApWJn2LyTQwxuJXwDCcnbrHuV7/SiBZAXhefJIWNLbvIU2IDKJ 8GXL9W+d/zI4Ff0zqTtCw70Piodz X-Google-Smtp-Source: ANB0VdbsJA8fVriQZplzaMWQzk3rgyMxt5EOKLjd8OXwGO/Oxpiy/MUFTrptOXYnha728IeIGtorKg== X-Received: by 2002:a81:8a82:: with SMTP id a124-v6mr1589154ywg.136.1534991258778; Wed, 22 Aug 2018 19:27:38 -0700 (PDT) Received: from localhost.localdomain (c-73-60-226-25.hsd1.nh.comcast.net. [73.60.226.25]) by smtp.gmail.com with ESMTPSA id l21-v6sm1270458ywb.108.2018.08.22.19.27.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Aug 2018 19:27:38 -0700 (PDT) From: Eric Whitney To: linux-ext4@vger.kernel.org Cc: tytso@mit.edu, Eric Whitney Subject: [RFC PATCH 0/6] ext4: rework bigalloc reserved cluster accounting Date: Wed, 22 Aug 2018 22:27:01 -0400 Message-Id: <20180823022707.14593-1-enwlinux@gmail.com> X-Mailer: git-send-email 2.11.0 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Ext4 can make gross overestimates of the number of reserved clusters required to handle bigalloc write requests under delayed allocation, resulting in premature ENOSPC and quota limit failures. These patches fix the implementation of reserved cluster accounting for bigalloc file systems configured to use delayed allocation, and fix the specific bugs described in bugzilla #151491. These patches also supersede a previous RFC posting from May 2018 ("ext4: rework delayed allocated cluster accounting"). Eric Whitney (6): ext4: generalize extents status tree search functions ext4: add new pending reservation mechanism ext4: fix reserved cluster accounting at delayed write time ext4: reduce reserved cluster count by number of allocated clusters ext4: adjust reserved cluster count when removing extents ext4: fix reserved cluster accounting at page invalidation time fs/ext4/ext4.h | 10 +- fs/ext4/ext4_extents.h | 13 + fs/ext4/extents.c | 602 ++++++++++++++++++++-------------------- fs/ext4/extents_status.c | 662 ++++++++++++++++++++++++++++++++++++++++++-- fs/ext4/extents_status.h | 85 +++++- fs/ext4/inode.c | 104 ++++--- fs/ext4/mballoc.c | 14 +- fs/ext4/super.c | 8 + include/trace/events/ext4.h | 99 +++++-- 9 files changed, 1199 insertions(+), 398 deletions(-)