From patchwork Sat Mar 24 01:56:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darrick Wong X-Patchwork-Id: 890364 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=oracle.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.b="ab7QvYVs"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 407NnV6F23z9s08 for ; Sat, 24 Mar 2018 12:57:02 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751553AbeCXB5B (ORCPT ); Fri, 23 Mar 2018 21:57:01 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:33102 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750789AbeCXB5A (ORCPT ); Fri, 23 Mar 2018 21:57:00 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w2O1ivGD041133; Sat, 24 Mar 2018 01:56:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : mime-version : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=uxnRs6g4zxvMbA+VecNpf5ZuDzXheb9eH9lKp8ML/GE=; b=ab7QvYVsdZYuOOIcGyCB10hELi4YdnIFTzDOBE4R/7pnrC+aDJpN41m1sE8JpYMfjVIx gXousrrSXsnUaZPQ3yHSSGYk3Cao/sz2jSCOzDx2w0/l1ekMCamLHYVYvJ4OFqiUaQS7 ZoZSA6wqtP9TbvtFxQO3mws5MZveYu8eLZjMy3wNYhAZYieHjppnyxEjOhXeFuGGNU9S AWnukElWIz57+Ae78B48SzpuhmFqrsbZfw1XO9lrEf9Ei96s++3axIs24pk5rY3DAbJ0 cJFcpmm8xo7sTsr5ziTPs3Y1+V9YfgdoXSVaqhqULWod+U3SCnUa8BK6LGbWOyG1CMtq pw== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2120.oracle.com with ESMTP id 2gwd8rr0f2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 24 Mar 2018 01:56:58 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w2O1uw1f005004 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 24 Mar 2018 01:56:58 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w2O1uvf3020090; Sat, 24 Mar 2018 01:56:57 GMT Received: from localhost (/10.159.132.121) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 23 Mar 2018 18:56:57 -0700 Subject: [PATCH v6 0/4] e2scrub: online fsck for ext4 From: "Darrick J. Wong" To: tytso@mit.edu, darrick.wong@oracle.com Cc: linux-ext4@vger.kernel.org Date: Fri, 23 Mar 2018 18:56:56 -0700 Message-ID: <152185661631.10434.3295057734679624788.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8841 signatures=668695 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803240010 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Hi all, This patch series develops the old e2croncheck contrib script into a more robust online filesystem checker for ext4. Since v4 I've modified e2scrub to accept mountpoints in preparation for a fsscrub wrapper for online metadata scrubbers, folded the e2scrub_reap script into e2scrub_all, and modified e2scrub_all to be a little more careful about selecting LVs to scan. The first patch enables tune2fs to set the error state bit so that we can force a fsck at next mount time. Patch 2 creates an e2scrub command that, given an ext4 filesystem on a LVM volume, creates a snapshot if there's more than 256M free in the LVM group, runs e2fsck on the snapshot, and deletes the snapshot. If the fsck ran cleanly, the fs last-check timestamp is updated and fstrim is run. If corruption is found we mark the fs as needing a fsck and advise a reboot. A udev rule file is used to prevent the creation of /dev/disk symlinks to the snapshot. Patch 3 introduces the e2scrub_all command that finds all ext4 filesystems living in LVM volumes and iteratively calls e2scrub on each of them. The fourth patch creates a weekly cron job for automatic invocation as well as systemd service files so that we can (try to) sandbox the scrub process and run it with idle priority to reduce latency spikes in the main filesystem. It also contains a scrub snapshot reaping service that will tear down old e2scrub snapshots during boot. Questions? Comments? This series targets e2fsprogs 1.45. --D