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 X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08967C282C2 for ; Thu, 7 Feb 2019 16:31:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C98B22175B for ; Thu, 7 Feb 2019 16:31:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JeSQoSZr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726558AbfBGQbc (ORCPT ); Thu, 7 Feb 2019 11:31:32 -0500 Received: from mail-yb1-f195.google.com ([209.85.219.195]:45633 "EHLO mail-yb1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726171AbfBGQbc (ORCPT ); Thu, 7 Feb 2019 11:31:32 -0500 Received: by mail-yb1-f195.google.com with SMTP id e131so165416ybh.12 for ; Thu, 07 Feb 2019 08:31:31 -0800 (PST) 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=CSKjxF1hHLTZzFsz5ZavRES9kKn+zoAQi7AlQl4sITQ=; b=JeSQoSZrpXwSXte64wCy6sNElTnB9TkO0NKwnVtg+Oldz+Ys9qngTeZG9puljDEAI2 TtFFZ2ZvMQpd/yYFDW4itQ9fPKVkP+kWQQwAekbobpV2zpcf+wxoEJqfwCTXxrrKTZuU MZ1tpB9Er/x9y+oYiR+O6COJRols2eLInJTo/dGWjAOZ/F4HK7hzA+HogRVro34398le UWjyTLYBfRhcocm2GmPz+a8b+Owfg/XVvsEog2HpA6iRXgwIAFL11XhWWra2XcHiXLt8 12mT3AB2mn+5tNlfCdYR+WfETQRwtb3YfQga6YzPBfyXPxjg7pu7lkVGFMAOH8laTVak 2K1Q== 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=CSKjxF1hHLTZzFsz5ZavRES9kKn+zoAQi7AlQl4sITQ=; b=W00SYwLVXwm6sed/VRadVQZCjWNEXLXuZmIMBHVfZENnnUc6aAaF6WNr3jUgpRw76j 8dsjsKYcKlupK/4QAOoMMFu83Qy8c0z/LZdBW7q7k/0FWpgc78oEidbCdRCNgdFnUANB A/g7rn4IzeeJBJ8z5IyKcPWLiBfiJAmQn54g6lgeyNfEaDftlXFlzuiVAD2uMNMVik8F daUyAM2zu7BnKnU89ZoKgN7DS5ZiptggCQISw+DQXZJa3Jo6eXwWn0ypJRtY/aNemzEr A5x1d+gBg4t1S59shEFaUdsKS/Xie0bm5a74ybZofsbr/QSn2bnFDb8YEDQui9cTibkW 0QIA== X-Gm-Message-State: AHQUAualuxCkrM/DPKS+LK8tXSEQwLYX3NHGI1fZzxFNe9PHyuCfkRr8 boDdrWssIjleTtnBkdboZ5NvXUwnNvILpnugRivmvTug X-Google-Smtp-Source: AHgI3IbqhupIMiv+NAcMv0axJztIg0ZGIByYuNLbnGRw8aZIPIdMwRBfYhN7TfgELZNgwFmXNWFbKlTCCuEyIYNZFUg= X-Received: by 2002:a25:374f:: with SMTP id e76mr13888324yba.337.1549557090878; Thu, 07 Feb 2019 08:31:30 -0800 (PST) MIME-Version: 1.0 References: <20190110170444.30616-1-amir73il@gmail.com> <20190110170444.30616-11-amir73il@gmail.com> <20190207144823.GF3597@quack2.suse.cz> In-Reply-To: <20190207144823.GF3597@quack2.suse.cz> From: Amir Goldstein Date: Thu, 7 Feb 2019 18:31:19 +0200 Message-ID: Subject: Re: [PATCH v5 10/17] fanotify: cache fsid in fsnotify_mark_connector To: Jan Kara Cc: Matthew Bobrowski , linux-fsdevel Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Thu, Feb 7, 2019 at 4:48 PM Jan Kara wrote: > > On Thu 10-01-19 19:04:37, Amir Goldstein wrote: > > For FAN_REPORT_FID, we need to encode fid with fsid of the filesystem on > > every event. To avoid having to call vfs_statfs() on every event to get > > fsid, we store the fsid in fsnotify_mark_connector on the first time we > > add a mark and on handle event we use the cached fsid. > > > > Subsequent calls to add mark on the same object are expected to pass the > > same fsid, so the call will fail on cached fsid mismatch. > > > > If an event is reported on several mark types (inode, mount, filesystem), > > all connectors should already have the same fsid, so we use the cached > > fsid from the first connector. > > > > Suggested-by: Jan Kara > > Signed-off-by: Amir Goldstein > > I've somewhat modified the patch to simplify code flow around > fanotify_get_fid() and also made fsid argument for > fsnotify_add_mark_locked() mandatory. The resulting patch is attached. > ACK. Two nits. 1. Dan Carpenter reported a smatch warning. Please fix: fs/notify/fanotify/fanotify.c:194 fanotify_encode_fid() error: uninitialized symbol 'type'. fs/notify/fanotify/fanotify.c:194 fanotify_encode_fid() error: uninitialized symbol 'err'. 2. checkpatch doesn't like cutting long debug strings into 80 chars (and Greg's linuxsty.vim plugin doesn't warn about them) referring to the long string that you broke up pr_warn_ratelimited("%s: fsid mismatch on object of type %u: "... Thanks, Amir.