From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Biggers Subject: Re: [PATCH v2 1/2] vfs: use READ_ONCE() to access ->i_link Date: Wed, 10 Apr 2019 16:15:48 -0700 Message-ID: <20190410231547.GC120258@gmail.com> References: <20190410202115.64501-1-ebiggers@kernel.org> <20190410202115.64501-2-ebiggers@kernel.org> <20190410210657.GA2217@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1hEMRj-0007xg-O5 for linux-f2fs-devel@lists.sourceforge.net; Wed, 10 Apr 2019 23:15:59 +0000 Received: from mail.kernel.org ([198.145.29.99]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) id 1hEMRg-00EXMk-Tw for linux-f2fs-devel@lists.sourceforge.net; Wed, 10 Apr 2019 23:15:59 +0000 Content-Disposition: inline In-Reply-To: <20190410210657.GA2217@ZenIV.linux.org.uk> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net To: Al Viro Cc: linux-fsdevel@vger.kernel.org, linux-fscrypt@vger.kernel.org, linux-ext4@vger.kernel.org, linux-mtd@lists.infradead.org, linux-f2fs-devel@lists.sourceforge.net On Wed, Apr 10, 2019 at 10:06:57PM +0100, Al Viro wrote: > On Wed, Apr 10, 2019 at 01:21:14PM -0700, Eric Biggers wrote: > > From: Eric Biggers > > > > Use 'READ_ONCE(inode->i_link)' to explicitly support filesystems caching > > the symlink target in ->i_link later if it was unavailable at iget() > > time, or wasn't easily available. I'll be doing this in fscrypt, to > > improve the performance of encrypted symlinks on ext4, f2fs, and ubifs. > > > > ->i_link will start NULL and may later be set to a non-NULL value by a > > smp_store_release() or cmpxchg_release(). READ_ONCE() is needed on the > > read side. smp_load_acquire() is unnecessary because only a data > > dependency barrier is required. (Thanks to Al for pointing this out.) > > You've missed vfs_readlink()... How so? The patch already updates vfs_readlink(). - Eric