Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3398840pxj; Tue, 11 May 2021 03:44:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgV9Il3UFZK3TPwr1TVdeMhge5FJYvI5pg/XsQ3POpEH3pCrtJdJl2Uhi2uc2GK78QXPrF X-Received: by 2002:a05:6e02:4e:: with SMTP id i14mr15043277ilr.145.1620729856953; Tue, 11 May 2021 03:44:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620729856; cv=none; d=google.com; s=arc-20160816; b=BC4ytQ4IalfgCzxKXPAYLBCnJoZp0iDUfU9Xlo/GM+HJGvY2vtSPOXrQ0HMNh18LmZ 3aBQFzf0wS8tVSqbvB8p/ZUCk2dSMCNKCAy4H6W40dUX5rMV7RVOsIHUleeTwR3fEpEc +x9zkAM4nWFtF19ynKb9LAJIDTR2HP8AStQhtLJJCFiwXdg0a9RhyyB5rBo90sEGR/tc diuuJi6pmAn+9pdhbkeD6tFAFUhfCX5I9mil1FKcW3iEuszARVTuN54R7fYoa2+hpLRe r/PP9H1sp677syBAeayzpU5CxaT8s4SXq+8AwOy/DdqDj18J9yz3TzLP0EMGnrGciPGT fXXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=Hp0pgYwJSsoZk+FL4cqBKXcyd7xatVJStixv9DIigWA=; b=gmixxSvKeed5f556P1CqM3XcVZ/DQklB34UpXzta+Sg+wx+yh/CiH6VHImrXzt7U9I TF9sKiJPasEV4VReQV8SeJsyFwLrurx87BK9ChQYeYamFq8+h+ht0d42A1rkpojkgZDr 2X8h32my+f5Iy3wMeglsUfIgy6GS583KhiqBVy93sOz8+6YPzvK7HCt1gWHYbNavL8lL cYscjaQSdZj/Xv9swjaLqiw+SfX6T9n9c3EMBc85H3iXoaMpqR1FieUJEjhOtgh3eZtD hwKdcHFcRrEv2XIxbKNt32rUPQZoRJO2VRBmrpydbU6A2vruw6SXzCGELNggDcmBUhLY n+pw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m18si3036387jaj.112.2021.05.11.03.44.02; Tue, 11 May 2021 03:44:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230519AbhEKKoh (ORCPT + 99 others); Tue, 11 May 2021 06:44:37 -0400 Received: from mx2.suse.de ([195.135.220.15]:36364 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231312AbhEKKoh (ORCPT ); Tue, 11 May 2021 06:44:37 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 6FB22B02C; Tue, 11 May 2021 10:43:28 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id AFA861F2B6D; Tue, 11 May 2021 12:43:27 +0200 (CEST) Date: Tue, 11 May 2021 12:43:27 +0200 From: Jan Kara To: Amir Goldstein Cc: Gabriel Krisman Bertazi , Theodore Tso , "Darrick J. Wong" , Dave Chinner , Jan Kara , David Howells , Khazhismel Kumykov , linux-fsdevel , Ext4 , kernel@collabora.com Subject: Re: [PATCH RFC 00/15] File system wide monitoring Message-ID: <20210511104327.GI24154@quack2.suse.cz> References: <20210426184201.4177978-1-krisman@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue 27-04-21 07:11:49, Amir Goldstein wrote: > The ring buffer functionality for fsnotify is interesting and it may be > useful on its own, but IMO, its too big of a hammer for the problem > at hand. > > The question that you should be asking yourself is what is the > expected behavior in case of a flood of filesystem corruption errors. > I think it has already been expressed by filesystem maintainers on > one your previous postings, that a flood of filesystem corruption > errors is often noise and the only interesting information is the first error. > > For this reason, I think that FS_ERROR could be implemented > by attaching an fsnotify_error_info object to an fsnotify_sb_mark: > > struct fsnotify_sb_mark { > struct fsnotify_mark fsn_mark; > struct fsnotify_error_info info; > } > > Similar to fd sampled errseq, there can be only one error report > per sb-group pair (i.e. fsnotify_sb_mark) and the memory needed to store > the error report can be allocated at the time of setting the filesystem mark. > > With this, you will not need the added complexity of the ring buffer > and you will not need to limit FAN_ERROR reporting to a group that > is only listening for FAN_ERROR, which is an unneeded limitation IMO. Seeing that this 'single error per mark' idea is gathering some support I'd like to add my 2c: Probably we don't want fsnotify_error_info attached to every fsnotify_mark, I guess we can have: struct fanotify_mark { struct fsnotify_mark fsn_mark; struct fanotify_error_event *event; }; and 'event' will be normally NULL and if we add FAN_ERROR to mark's mask, we will allocate event (also containing error info) to use when generating error event. And then the handling will be somewhat similar to how we handle overflow events. Honza -- Jan Kara SUSE Labs, CR