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=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT 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 A7055C282C2 for ; Thu, 7 Feb 2019 14:57:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 791FD2147C for ; Thu, 7 Feb 2019 14:57:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726606AbfBGO56 (ORCPT ); Thu, 7 Feb 2019 09:57:58 -0500 Received: from mx2.suse.de ([195.135.220.15]:46000 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726048AbfBGO55 (ORCPT ); Thu, 7 Feb 2019 09:57:57 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id BD16CAC43; Thu, 7 Feb 2019 14:57:56 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 445F61E3DB5; Thu, 7 Feb 2019 15:57:56 +0100 (CET) Date: Thu, 7 Feb 2019 15:57:56 +0100 From: Jan Kara To: Amir Goldstein Cc: Jan Kara , Matthew Bobrowski , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v5 13/17] fsnotify: report FS_ISDIR flag with MOVE_SELF and DELETE_SELF events Message-ID: <20190207145756.GG3597@quack2.suse.cz> References: <20190110170444.30616-1-amir73il@gmail.com> <20190110170444.30616-14-amir73il@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190110170444.30616-14-amir73il@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Thu 10-01-19 19:04:40, Amir Goldstein wrote: > @@ -111,6 +118,9 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, > new_dir_mask |= FS_ISDIR; > } > > + if (d_is_dir(moved)) > + mask |= FS_ISDIR; > + > fsnotify(old_dir, old_dir_mask, source, FSNOTIFY_EVENT_INODE, old_name, > fs_cookie); > fsnotify(new_dir, new_dir_mask, source, FSNOTIFY_EVENT_INODE, new_name, The 'isdir' argument of fsnotify_move() is exactly d_is_dir(moved). So I've simplified the code by: if (isdir) { old_dir_mask |= FS_ISDIR; new_dir_mask |= FS_ISDIR; - } - - if (d_is_dir(moved)) mask |= FS_ISDIR; + } Honza -- Jan Kara SUSE Labs, CR