Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp4249379pxy; Mon, 26 Apr 2021 23:50:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKI4NecTQgEhM0RkvTRAVJAk/GyEPnq8pAUW5zmzf47Bfp0T8wGEeEcDHfB+oMecMr8ec9 X-Received: by 2002:a17:90a:1747:: with SMTP id 7mr24939826pjm.109.1619506205925; Mon, 26 Apr 2021 23:50:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619506205; cv=none; d=google.com; s=arc-20160816; b=lh6W4zO1tRUgAuMe47FFKKzEmhGhl9tx/fqM8iQmfoThXGUYiaIYUryVm2dTqKBQwd fj8jHTv01y/p8+jcxOOJHH34+uCKzWPTkB3ythaWmflDWcfTcF1KIKQ8PS109Vr9jt8j b2OVuefYiQa6Hx2Y3xB4owefkl2h/x4Q8m5AmXvmZRstOmxco7FBxBTy0eIrTjPx8iN2 McKGyC8MQ3tdUEqvvy7E3c1h0gFbDap+uLtDbW8uRG///zwHb4M2dbaHvrOClFWS9GSB eiLGCQQEEH9ML1dH9nY19t+BF4SVNzxrbrWr39mZkpr6SPLqgEQx2YXicJ0qJyxKbqKI p8Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Y1jTpRmc2KSVl4/75I1+x30oNZwT8EP+wM9qHtCp5hk=; b=Yj2oMNJAjyAYV2kZn4fo3bdzBOT2JYNWvqj/UVcjkQsfszWgw9dWFDuV0O7ExhOyDy Zgpkgd+/KP7dHd4syYcI3ypcSgeEBJGJUdEA+QzTXezezMFDms5t0fOrBioBE5O3q2cD Y3NMEYWw8ayazh0lfPmDalB9J40vCNU4kHhU8bueeeTu0N/bWY9rDknPBOcTSq6ZXTSX pEcHOa1gzy9N+KacOKuU2Bd//MIILSa2Jn8tHUVl/GPapprQdoqwJwfyJPe44ckf5SJj 8P+Sr0FZmHJFZFJ+0CBjvUA7JTHN/dQHQ1iWpD2CePXGouaZRDzJK23bTPFo/uzHnQ0h n0HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=W+vGBVl+; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v10si10659672plp.428.2021.04.26.23.49.49; Mon, 26 Apr 2021 23:50:05 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=W+vGBVl+; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231327AbhD0Gu1 (ORCPT + 99 others); Tue, 27 Apr 2021 02:50:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229923AbhD0Gu1 (ORCPT ); Tue, 27 Apr 2021 02:50:27 -0400 Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFBCEC061574; Mon, 26 Apr 2021 23:49:42 -0700 (PDT) Received: by mail-io1-xd2c.google.com with SMTP id b9so6574221iod.13; Mon, 26 Apr 2021 23:49:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Y1jTpRmc2KSVl4/75I1+x30oNZwT8EP+wM9qHtCp5hk=; b=W+vGBVl+Og/OT6pEGEjcAyA3R8CejUsG8iFJ0y4n6KmNri9yXyex3HCrWr/oTEWv2f JOJ6IVK0u5fqQOh9h9AF9yyQpeZTgc2Ark6OhySnQJf7BBw/blhC1rI8Ad8+lLvipqmv C5CjHodzgTx1DI8JDpZmefkgUJ547FwUEtnWJbM+5I0tuJ/gM4WZgXTTt7hAysej1Atg gC9a1i99OOgklppfLAME3ASyw4ltdGZpAbScsw0Xw6LqsN4PUA51j649napY/XeDs9UL 41gNVZyduZuC+xaMIpuBejVRshAsHxlG93ig1keMdcvJd0jkbisPeWc6SA3/hEWqWSDt 02iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Y1jTpRmc2KSVl4/75I1+x30oNZwT8EP+wM9qHtCp5hk=; b=nl6rlQuYRYrHDIDgsHVzP45Z5XwkkXXF2k0xXejXxhEI3/W/b920FbRL582BfQBTDX DSzIWqKO/v1aPQ5vb7FxAl7V4XMCH9Rchz1I+zixegGeixmWaiScdAGU6CRZund1qzcc LFfFx++MzyoeqYioK5c8n2v4CC/WOW4pItOxhwJRkkz4MvG/FfZ5BsKPi9S0B1Pe76CY /4ocsjYsFRbH2EXBZzrMKjj3yF1tLbyX3/uVr9IXLlukGVe6EClQvfMCt0yl0jm6SxNI mPAddbOyY0dAAGiXTHcK+f3ZrQNZkBAqsPB5ZRayFlTLBwjICLuSM+vT8bsKm355+tjF FSmQ== X-Gm-Message-State: AOAM532nKu8smFY6WkIu1Vi2bbg+4MSk8knQDZiZMkaci/2Pj3HHg3zo 4dbuT+68hXa9BUeyGFvdLqeHzWxnNa2zsoSSYh5jIuWK2rk= X-Received: by 2002:a6b:d213:: with SMTP id q19mr17731537iob.203.1619506182378; Mon, 26 Apr 2021 23:49:42 -0700 (PDT) MIME-Version: 1.0 References: <20210426184201.4177978-1-krisman@collabora.com> <20210426184201.4177978-9-krisman@collabora.com> In-Reply-To: <20210426184201.4177978-9-krisman@collabora.com> From: Amir Goldstein Date: Tue, 27 Apr 2021 09:49:31 +0300 Message-ID: Subject: Re: [PATCH RFC 08/15] fsnotify: Introduce helpers to send error_events To: Gabriel Krisman Bertazi Cc: Theodore Tso , "Darrick J. Wong" , Dave Chinner , Jan Kara , David Howells , Khazhismel Kumykov , linux-fsdevel , Ext4 , kernel@collabora.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon, Apr 26, 2021 at 9:42 PM Gabriel Krisman Bertazi wrote: > > Signed-off-by: Gabriel Krisman Bertazi > --- > include/linux/fsnotify.h | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h > index f8acddcf54fb..b3ac1a9d0d4d 100644 > --- a/include/linux/fsnotify.h > +++ b/include/linux/fsnotify.h > @@ -317,4 +317,19 @@ static inline void fsnotify_change(struct dentry *dentry, unsigned int ia_valid) > fsnotify_dentry(dentry, mask); > } > > +static inline void fsnotify_error_event(int error, struct inode *dir, > + const char *function, int line, > + void *fs_data, int fs_data_size) > +{ > + struct fs_error_report report = { > + .error = error, > + .line = line, > + .function = function, > + .fs_data_size = fs_data_size, > + .fs_data = fs_data, > + }; > + > + fsnotify(FS_ERROR, &report, FSNOTIFY_EVENT_ERROR, dir, NULL, NULL, 0); The way you use this helper from ext4_fsnotify_error() it would make more sense to name the inode argument 'inode' and call: fsnotify(FS_ERROR, &report, FSNOTIFY_EVENT_ERROR, NULL, NULL, inode, 0); Also, if we stick with returning ENOMEM instead of overflow event (I don't think we should), then this helper should return the error as well. Thanks, Amir.