From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Howells Date: Wed, 29 May 2019 10:55:10 +0000 Subject: Re: [PATCH 3/7] vfs: Add a mount-notification facility Message-Id: <13970.1559127310@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit List-Id: References: <155905930702.7587.7100265859075976147.stgit@warthog.procyon.org.uk> <155905933492.7587.6968545866041839538.stgit@warthog.procyon.org.uk> In-Reply-To: To: Jann Horn Cc: dhowells@redhat.com, Al Viro , raven@themaw.net, linux-fsdevel , Linux API , linux-block@vger.kernel.org, keyrings@vger.kernel.org, linux-security-module , kernel list Jann Horn wrote: > > + /* Global root? */ > > + if (mnt != parent) { > > + cursor.dentry = READ_ONCE(mnt->mnt_mountpoint); > > + mnt = parent; > > + cursor.mnt = &mnt->mnt; > > + continue; > > + } > > + break; > > (nit: this would look clearer if you inverted the condition and wrote > it as "if (mnt = parent) break;", then you also wouldn't need that > "continue" or the braces) It does look better with the logic inverted, but you *do* still need the continue. After the if-statement, there is: cursor.dentry = cursor.dentry->d_parent; which we need to skip. It might make sense to move that into an else-statement from an aesthetic point of view. David