Date: Fri, 28 Jun 2013 14:54:08 +0100 From: Al Viro To: Joakim Tjernlund Subject: Re: [PATCH 1/2] UBIFS: prepare to fix a horrid bug Message-ID: <20130628135408.GG4165@ZenIV.linux.org.uk> References: <1372418115-16713-1-git-send-email-dedekind1@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Cc: Linux FS Maling List , linux-mtd , MTD Maling List , Artem Bityutskiy List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Fri, Jun 28, 2013 at 02:27:58PM +0200, Joakim Tjernlund wrote: > > So here we introduce a local variable 'pos', read 'file->f_pose' once at > very > > the beginning, and then stick to 'pos'. The result of this is that when > > 'ubifs_dir_llseek()' changes 'file->f_pos' while we are in the middle of > > 'ubifs_readdir()', the latter "wins". > > Ouch, I hope JFFS2 doesn't have the same bug? FWIW, this class of bugs (f_pos races, *not* kfree-under-us) is dealt with by switch to saner API - see commits in linux-next marked [readdir]