Return-Path: Received: from mx2.suse.de ([195.135.220.15]:53437 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751014AbcIIPDo (ORCPT ); Fri, 9 Sep 2016 11:03:44 -0400 Date: Fri, 9 Sep 2016 17:03:42 +0200 From: Jan Kara To: Miklos Szeredi Cc: Jan Kara , linux-fsdevel , Al Viro , Lino Sanfilippo , Eric Paris Subject: Re: [PATCH 1/3] fsnotify: Use enum for return values of fsnotify_add_event() Message-ID: <20160909150342.GB20706@quack2.suse.cz> References: <1473344745-20634-1-git-send-email-jack@suse.cz> <1473344745-20634-2-git-send-email-jack@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri 09-09-16 15:01:46, Miklos Szeredi wrote: > On Thu, Sep 8, 2016 at 4:25 PM, Jan Kara wrote: > > Currently there are three possible returns from fsnotify_add_event(). We > > will be adding a fourth one. Let's change magic numbers to enum to make > > things clearer. > > This cleanup should go last, otherwise it'll just make backporting the > fix harder. > > Also I don't really see the value of having a big enum with 3 of the > values having the same meaning. Yeah, there's that BUG_ON for having > merged a permission event. But it checks the very obvious condition > at the top of fanotify_merge() with the big comment, not very > interesting. > > So I'd kill the BUG_ON, drop the merged/overflowed/shutdown > distinction and return a two way value (doing it with an enum still > makes the code more readable, though). Fair enough, I'll fix this up and resend the series (likely early next week). Honza -- Jan Kara SUSE Labs, CR