From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Howells Subject: Re: [PATCH 00/16] vfs: atomic open v4 (part 1) Date: Fri, 25 May 2012 16:20:03 +0100 Message-ID: <13720.1337959203@redhat.com> References: <87fwaoi9by.fsf@tucsk.pomaz.szeredi.hu> <6422.1337872046@redhat.com> <1335357857-16416-1-git-send-email-miklos@szeredi.hu> <7204.1337874722@redhat.com> Cc: dhowells@redhat.com, viro@ZenIV.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, hch@infradead.org, torvalds@linux-foundation.org To: Miklos Szeredi Return-path: In-Reply-To: <87fwaoi9by.fsf@tucsk.pomaz.szeredi.hu> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Miklos Szeredi wrote: > > Also, does it make sense to combine: > > > > if (!S_ISREG(nd->inode->i_mode)) > > will_truncate = 0; > > > > with: > > > > int will_truncate = open_flag & O_TRUNC; > > > > up at the top of the function. > > We need to check nd->inode->i_mode *after* the lookup. So top of the > function is not a good place. Good point. David