From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753111AbdFRUpy (ORCPT ); Sun, 18 Jun 2017 16:45:54 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:33166 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752253AbdFRUpu (ORCPT ); Sun, 18 Jun 2017 16:45:50 -0400 Date: Sun, 18 Jun 2017 13:45:41 -0700 (PDT) From: Richard Narron X-X-Sender: comet.berkeley@joy.test To: Al Viro cc: Linus Torvalds , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [git pull] first batch of ufs fixes In-Reply-To: <20170618010923.GX31671@ZenIV.linux.org.uk> Message-ID: References: <20170610180831.GF6365@ZenIV.linux.org.uk> <20170612061417.GB31671@ZenIV.linux.org.uk> <20170613014302.GC31671@ZenIV.linux.org.uk> <20170614071133.GD31671@ZenIV.linux.org.uk> <20170615080009.GE31671@ZenIV.linux.org.uk> <20170617021548.GR31671@ZenIV.linux.org.uk> <20170618010923.GX31671@ZenIV.linux.org.uk> User-Agent: Alpine 2.21 (LNX 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 18 Jun 2017, Al Viro wrote: > On Sat, Jun 17, 2017 at 03:15:48AM +0100, Al Viro wrote: >> On Fri, Jun 16, 2017 at 07:29:00AM -0700, Richard Narron wrote: >> >>> The 8 patches in the ufs-fixes group were applied to Linux 4.12-rc5. >>> They seem to work fine with the simple testing that I do. >>> >>> I tested all 3 BSDs, FreeBSD 11.0, OpenBSD 6.1 and NetBSD 7.1 using 2 >>> filesystems, 44bsd (ufs1) and ufs2. >>> I found no errors doing a Linux mkdir, copy large file, BSD fsck, Linux rm >>> large file, rmdir and BSD fsck in any of the 6 combinations. >> >> FWIW, with xfstests I see the following: >> * _require_metadata_journaling needs to be told not to bother with >> our ufs >> * generic/{409,410,411} lack $MOUNT_OPTIONS in several invocations >> of mount -t $FSTYP; for ufs it's obviosuly a problem. Trivial bug in tests, >> fixing it makes them pass. >> * generic/258 (timestamp wraparound) fails; fs is left intact > > Trivially fixed (cast to (signed) in ufs1_read_inode(), similar to what > other filesystems with 32bit timestamps are doing); ufs2 has no problem > at all) > >> * generic/426 (fhandle stuff) fails and buggers the filesystem >> Everything else passes with no fs corruption that could be detected by >> fsck.ufs. > > Also trivially fixed - it's a self-inflicted wound. Just have zero nlink in > ufs{1,2}_read_inode() fail with -ESTALE instead of triggering ufs_error(). > >> As for my immediate plans, I'll look into the two failing tests, >> but any further active work on ufs will have to wait for the next >> cycle. It had been a fun couple of weeks, but I have more than >> enough other stuff to deal with. And I would still very much prefer >> for somebody to adopt that puppy. > > Another piece of fun spotted: the logics for switching between two allocation > policies when relocating a packed tail that can't be expanded in place had > been b0rken since typo in 2.4.14.7 - switch back from OPTTIME to OPTSPACE > had been screwed by this: > - usb1->fs_optim = SWAB32(UFS_OPTSPACE); > + usb1->fs_optim = cpu_to_fs32(sb, UFS_OPTTIME); > > And fragmentation levels for switching back and force really ought to be > calculated at mount time. Another (minor) issue is mentioned in this > commit message from Kirck McKusick back in 1995: > The threshold for switching from time-space and space-time is too small > when minfree is 5%...so make it stay at space in this case. > Not that minfree at 5% had been frequently seen - default has never been that > low (back in 4.2BSD it was 10%, these days it's 8%) > > Resulting kernel passes xfstests clean and now I'm definitely done with UFS for > this cycle. Linus, in case you want to pull that sucker, pull request would > be as below: > > The following changes since commit a8fad984833832d5ca11a9ed64ddc55646da30e3: > > ufs_truncate_blocks(): fix the case when size is in the last direct block (2017-06-15 03:57:46 -0400) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git ufs-fixes > > for you to fetch changes up to 77e9ce327d9b607cd6e57c0f4524a654dc59c4b1: > > ufs: fix the logics for tail relocation (2017-06-17 17:22:42 -0400) > > ---------------------------------------------------------------- > Al Viro (3): > fix signedness of timestamps on ufs1 > ufs_iget(): fail with -ESTALE on deleted inode > ufs: fix the logics for tail relocation > > fs/ufs/balloc.c | 22 ++++++---------------- > fs/ufs/inode.c | 27 +++++++++++---------------- > fs/ufs/super.c | 9 +++++++++ > fs/ufs/ufs_fs.h | 2 ++ > 4 files changed, 28 insertions(+), 32 deletions(-) > I just tested these 3 patches along with the earlier 8 patches against Linux 4.12-rc5 and they look fine. All 6 test cases look good. The ufs code is much better now than it was before all these patches.