Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751277AbdHFCuq (ORCPT ); Sat, 5 Aug 2017 22:50:46 -0400 Received: from imap.thunk.org ([74.207.234.97]:41316 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751219AbdHFCup (ORCPT ); Sat, 5 Aug 2017 22:50:45 -0400 Date: Sat, 5 Aug 2017 22:50:42 -0400 From: "Theodore Ts'o" To: Andreas Dilger Cc: Tahsin Erdogan , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ext4: inplace xattr block update fails to deduplicate blocks Message-ID: <20170806025042.anluiwr3bsr2z4ng@thunk.org> Mail-Followup-To: Theodore Ts'o , Andreas Dilger , Tahsin Erdogan , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org References: <20170715002529.31045-1-tahsin@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1242 Lines: 36 On Sat, Jul 15, 2017 at 02:49:05AM -0700, Andreas Dilger wrote: > On Jul 14, 2017, at 5:25 PM, Tahsin Erdogan wrote: > > > > When an xattr block has a single reference, block is updated inplace > > and it is reinserted to the cache. Later, a cache lookup is performed > > to see whether an existing block has the same contents. This cache > > lookup will most of the time return the just inserted entry so > > deduplication is not achieved. > > > > Running the following test script will produce two xattr blocks which > > can be observed in "File ACL: " line of debugfs output: > > > > mke2fs -b 1024 -I 128 -F -O extent /dev/sdb 1G > > mount /dev/sdb /mnt/sdb > > > > touch /mnt/sdb/{x,y} > > > > setfattr -n user.1 -v aaa /mnt/sdb/x > > setfattr -n user.2 -v bbb /mnt/sdb/x > > > > setfattr -n user.1 -v aaa /mnt/sdb/y > > setfattr -n user.2 -v bbb /mnt/sdb/y > > > > debugfs -R 'stat x' /dev/sdb | cat > > debugfs -R 'stat y' /dev/sdb | cat > > > > This patch defers the reinsertion to the cache so that we can locate > > other blocks with the same contents. > > > > Signed-off-by: Tahsin Erdogan > > Reviewed-by: Andreas Dilger Thanks, applied. - Ted