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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28BD1C433F5 for ; Wed, 17 Nov 2021 09:00:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B891C61BF8 for ; Wed, 17 Nov 2021 09:00:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B891C61BF8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 1192E6B006C; Wed, 17 Nov 2021 04:00:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0C8406B0073; Wed, 17 Nov 2021 04:00:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EF8DD6B0074; Wed, 17 Nov 2021 04:00:38 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0103.hostedemail.com [216.40.44.103]) by kanga.kvack.org (Postfix) with ESMTP id E08186B006C for ; Wed, 17 Nov 2021 04:00:38 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 9E419180C8505 for ; Wed, 17 Nov 2021 09:00:28 +0000 (UTC) X-FDA: 78817826220.01.DFF21A4 Received: from mail-il1-f182.google.com (mail-il1-f182.google.com [209.85.166.182]) by imf06.hostedemail.com (Postfix) with ESMTP id 98968801AB16 for ; Wed, 17 Nov 2021 09:00:26 +0000 (UTC) Received: by mail-il1-f182.google.com with SMTP id e8so1969413ilu.9 for ; Wed, 17 Nov 2021 01:00:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JlSd65TPdJImWZn2fR0v75dkXdB8h4NRMtQ4KabfG38=; b=HZ4WPA9+lUIwokJ8/CbpLPPjkIUcGkZIPBbPrTitvW+RGHTFz8ZMNTZ5lZuvRqMI/W mjbfYwrsJ9YK0P7gQmEXVHY7erHwLEuxuUGCSbPwTtipwulBNajTtlNmcw6rcgKINx+w NpfWJ0DRuxAyJ1xEBCWg9gr7vvhEF6fJqY8CvECRPVrVZkXQscr8bH2mbZVDijQiD59I TVXK18RQvqIxWeQUafxNvso200T5xS2rrrt5MaO1vLb5Nz4GpuxkMVb9ikKTQkZZP77i 2cRWFTBtO3+H5A+d8dHtvGvCiadiMYP1QT14l550k6LbSxhC/cf6JTpAKqsJwnEeQllz lseg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JlSd65TPdJImWZn2fR0v75dkXdB8h4NRMtQ4KabfG38=; b=FLSpNrwMJ1c1XIPWdpjFylp4fB/k5C3oCPsNo/00dfv2MNa9F/hFCxEEYrtqGT1N5Z 7bWmpxy3ipCY4JQLa62Dsd47E2GRdIXmD8b+JfvSaDbajwNRq9tTZTwgUmUszGO0Dbx/ KacipWjgg+8Y6AKRKr83wh2ArkBzBkMLLspKAWYyQBNBjQYxNfQk/1X1w7zRFbQHvXwc hIfgdeSYtJTthT6AhN0rnELtW68XmKDc8atNZUKOXVOhr54vXs6vQkf+fApN/tLcbM6o adquB1FQvqUSh+JbaDVV+rQls1lBDb+pv8zuE+QoAXmgBnrSrCJ6uT/dK9+Kere88VyU QSFg== X-Gm-Message-State: AOAM530CjDy4/q938izk9IDViNzxBpHItPQlz1VN1Shw5mRoEm7/dXxH CIn7Eigr/YjACBJwH6JHz+3IOmebKzA2qytwmXU= X-Google-Smtp-Source: ABdhPJxK1C12vQsQFECIS53UQK+zhUyYO25XZIiepjikE/ABncuxyMVte46adyO8HUxAUfboPb/+3XTQ3xMhnwrwqso= X-Received: by 2002:a92:c983:: with SMTP id y3mr8768390iln.24.1637139626998; Wed, 17 Nov 2021 01:00:26 -0800 (PST) MIME-Version: 1.0 References: <20211116220742.584975-1-krisman@collabora.com> In-Reply-To: <20211116220742.584975-1-krisman@collabora.com> From: Amir Goldstein Date: Wed, 17 Nov 2021 11:00:16 +0200 Message-ID: Subject: Re: [PATCH 0/2] shmem: Notify user space when file system is full To: Gabriel Krisman Bertazi Cc: Hugh Dickins , Andrew Morton , Linux MM , Jan Kara , Matthew Bobrowski , Khazhismel Kumykov , kernel@collabora.com Content-Type: text/plain; charset="UTF-8" X-Stat-Signature: z63oi1c1gz9e7xzwkfdgk573ffg5a9z4 Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=HZ4WPA9+; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf06.hostedemail.com: domain of amir73il@gmail.com designates 209.85.166.182 as permitted sender) smtp.mailfrom=amir73il@gmail.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 98968801AB16 X-HE-Tag: 1637139626-280627 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Nov 17, 2021 at 12:07 AM Gabriel Krisman Bertazi wrote: > > FS_ERROR is a fsnotify event type used by monitoring tools to detect > conditions that might require intervention from a recovery tool or from > sysadmins. This patch series enables tmpfs to report an event when an > operation fails because the file system is full. > > It attempts to only report events when the filesystem is really full, > instead of errors caused by memory pressure. The first patch prepares > the terrain by detecting these two different conditions, and the second > patch actually adds the event triggers. > Hi Gabriel, Two things bother me about this proposal. One is that it makes more sense IMO to report ENOSPC events from vfs code. Why should the requirement to monitor ENOSPC conditions be specific to tmpfs? Especially, as I mentioned, there are already wrappers in place to report writeback errors on an inode (mapping_set_error), where the fsnotify hook can fit nicely. I understand that you wanted to differentiate errors caused by memory pressure, but I don't understand why it makes sense for a filesystem monitor to get a different feedback than the writing application. The second thing that bothers me is that I think the ENOSPC condition should not be reported on the same event mask as filesystem corruption condition because it seems like a valid use case for filesystem monitor to want to be notified about corruption and not about ENOSPC. Therefore, I suggested using the event flag FS_WB_ERROR for writeback errors. Other than the event mask, everything else is the same. It just provides the UAPI flexibility to subscribe to one without the other. Thanks, Amir.