Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp462907pxb; Mon, 16 Aug 2021 09:19:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzy0RZpK+KKb1EHJpXEIx+GaQHNUvhIcvsxBbdtcEun28mAlx6aK9AT0byBy/R6WgIQvWGb X-Received: by 2002:a05:6638:3048:: with SMTP id u8mr16073739jak.91.1629130768630; Mon, 16 Aug 2021 09:19:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629130768; cv=none; d=google.com; s=arc-20160816; b=AohOpMB/PxCJ5L0gU2R81tz5XhdePxfZY7akv0iAlc8pskLuOPRxTFD2QCtkis0mjW u+vFpMuzjfGM9zmHqx9f6CWAv+VyhsGRxE5FGXtMoTw0gYqriJlA8LjQsg4bvVuLpJM+ nC9g9GLubEiZYYNvqGVRthHBtc8EhEzigdKQ3Vl1FgNdPL9UQq2zniha9dwKPQFp3c9R mtZY3Boo9VhLgfP4yXR3quQA9rQa2VAKCTho5aiZGh2f/Wg61K+fK3EwajTNngxd4OEX TmxIk6+9ylkR44N1p4d2Q9Oojkq6jzOlTOovuEaDu52fWWo5QmBLoG/5WAs2GpIRHTqa m/hA== 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 :dkim-signature:dkim-signature; bh=dOmpSbGnSUnjg17PYw2j4xFI3oFj7kA15QGM0EW5OKc=; b=Wltf672wza2wzxIl/Gfmw/HIOGWju34MvtghqRgkuD6iwfahuGyBFMhW4rHH7OPgGG sfz3/dnIm3T3hk5bOSpLrFI7WzSzjHtgDNxHl1axWrCQl+G8Yp/0spa37Z+wi0aENPJ8 ryB2v0YbWfxoD1eBPqNoUZ2s89pkGGVf37Sm+sgMzLHdu3um82BMqISU92vBS82qEn/v Z6ZkO/KUv+B+gEQ3UX5WSf2NSgIQ107SqtClS+gIgOtXlmeth4dO70a/ZZp/T67kf664 CIx5uXvkR0z5pZhSO63PbcYmABWqo6aURWQTeiZsSIb/0kVPjm97TpmPJBSWlCe5jUB1 oHwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="gws/2yv4"; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=vzIuPLVI; 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 b19si4579767jaq.82.2021.08.16.09.19.12; Mon, 16 Aug 2021 09:19:28 -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=@suse.cz header.s=susede2_rsa header.b="gws/2yv4"; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=vzIuPLVI; 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 S231307AbhHPQTD (ORCPT + 99 others); Mon, 16 Aug 2021 12:19:03 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:45254 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230107AbhHPQSz (ORCPT ); Mon, 16 Aug 2021 12:18:55 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id EC5581FF96; Mon, 16 Aug 2021 16:18:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1629130701; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=dOmpSbGnSUnjg17PYw2j4xFI3oFj7kA15QGM0EW5OKc=; b=gws/2yv49yFxSBjlSGJEzRrk7ANXvzsIupS15VGzd5XNQWok20EWE/mUY/nfQ5xksbl9gy +4CFz2MPDlUm9TlOTFynqs/EYIi9VIeTZ5EdECL5Ueb/eF0bx3cZfuNWXdPgVQXfwVxON3 qRUpFT0x/rtLvThmK3Jgz0VAXvB5HBc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1629130701; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=dOmpSbGnSUnjg17PYw2j4xFI3oFj7kA15QGM0EW5OKc=; b=vzIuPLVIox+HJVKQrBOs0goWSjEYs4iN8iCsDPCnAWltkOFRe5vcLRPiGyX9TNnNgG3SDm nLKeh7pQO37G+EBw== Received: from quack2.suse.cz (unknown [10.100.224.230]) by relay2.suse.de (Postfix) with ESMTP id D078EA3B8F; Mon, 16 Aug 2021 16:18:21 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 8CE3B1E0426; Mon, 16 Aug 2021 18:18:18 +0200 (CEST) Date: Mon, 16 Aug 2021 18:18:18 +0200 From: Jan Kara To: Gabriel Krisman Bertazi Cc: amir73il@gmail.com, jack@suse.com, linux-api@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, khazhy@google.com, dhowells@redhat.com, david@fromorbit.com, tytso@mit.edu, djwong@kernel.org, repnop@google.com, kernel@collabora.com Subject: Re: [PATCH v6 17/21] fanotify: Report fid info for file related file system errors Message-ID: <20210816161818.GH30215@quack2.suse.cz> References: <20210812214010.3197279-1-krisman@collabora.com> <20210812214010.3197279-18-krisman@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210812214010.3197279-18-krisman@collabora.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu 12-08-21 17:40:06, Gabriel Krisman Bertazi wrote: > Plumb the pieces to add a FID report to error records. Since all error > event memory must be pre-allocated, we estimate a file handle size and > if it is insuficient, we report an invalid FID and increase the > prediction for the next error slot allocation. This needs updating. The code now uses MAX_HANDLE_SZ... > For errors that don't expose a file handle report it with an invalid > FID. > > Signed-off-by: Gabriel Krisman Bertazi > > --- > Changes since v5: > - Use preallocated MAX_HANDLE_SZ FH buffer > - Report superblock errors with a zerolength INVALID FID (jan, amir) > --- > fs/notify/fanotify/fanotify.c | 15 +++++++++++++++ > fs/notify/fanotify/fanotify.h | 11 +++++++++++ > fs/notify/fanotify/fanotify_user.c | 7 +++++++ > 3 files changed, 33 insertions(+) > > diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c > index 0c7667d3f5d1..f5c16ac37835 100644 > --- a/fs/notify/fanotify/fanotify.c > +++ b/fs/notify/fanotify/fanotify.c > @@ -734,6 +734,8 @@ static int fanotify_handle_error_event(struct fsnotify_iter_info *iter_info, > struct fanotify_sb_mark *sb_mark = > FANOTIFY_SB_MARK(fsnotify_iter_sb_mark(iter_info)); > struct fanotify_error_event *fee = sb_mark->fee_slot; > + struct inode *inode = report->inode; > + int fh_len; > > spin_lock(&group->notification_lock); > if (fee->err_count++) { > @@ -743,6 +745,19 @@ static int fanotify_handle_error_event(struct fsnotify_iter_info *iter_info, > spin_unlock(&group->notification_lock); > > fee->fae.type = FANOTIFY_EVENT_TYPE_FS_ERROR; > + fee->fsid = fee->sb_mark->fsn_mark.connector->fsid; Why don't you use sb_mark directly? Otherwise the patch looks good to me. Honza -- Jan Kara SUSE Labs, CR