From owner-freebsd-fs@FreeBSD.ORG Mon May 31 01:16:54 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 155F71065677 for ; Mon, 31 May 2010 01:16:54 +0000 (UTC) (envelope-from pierre@userid.org) Received: from mail.storm.ca (unknown [IPv6:2607:f0b0:0:6:209:87:239:66]) by mx1.freebsd.org (Postfix) with ESMTP id D2ACB8FC18 for ; Mon, 31 May 2010 01:16:53 +0000 (UTC) Received: from mail.userid.org (pandora.userid.org [216.106.102.33]) by mail.storm.ca (8.14.2+Sun/8.14.2) with ESMTP id o4V0SQrQ023899 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 30 May 2010 20:28:31 -0400 (EDT) Received: from [IPv6:2607:f0b0:1:3800:1406:740f:3344:31f1] (unknown [IPv6:2607:f0b0:1:3800:1406:740f:3344:31f1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: pierre) by mail.userid.org (Postfix) with ESMTP id 933652C779E for ; Sun, 30 May 2010 20:28:15 -0400 (EDT) Message-ID: <4C0302A8.2000702@userid.org> Date: Sun, 30 May 2010 20:28:24 -0400 From: Pierre Lamy User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: freebsd-fs X-userid-MailScanner-Information: Please contact the ISP for more information X-userid-MailScanner-ID: 933652C779E.A197F X-userid-MailScanner: Found to be clean X-userid-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=0, required 6, autolearn=not spam, HTML_MESSAGE 0.00, NO_RELAYS -0.00) X-userid-MailScanner-From: pierre@userid.org X-Spam-Status: No Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Trying to understand the boot process X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2010 01:16:54 -0000 I've got a nice little Atom box with a CF and hard drive, and I can currently boot NanoBSD off the flash no problem. I would like to optionally select the HD as a bootable device, and it does show up in the boot: 1 FreeBSD 3 FreeBSD 5 Drive 1 Now, I have already set a slice and put /boot in ad4s1a, and FreeBSD is manually installed out of a chroot'ed install (tar'd on seperate system and extracted correctly to the appropriate local HD filesystem) but I can't figure out how to actually get it booted, it seems to be missing the MBR? I have already RTFM, and used bsdlabel -B ad4s1, and also tried fdisk -B. I simply get the "Reboot and select proper boot device or insert boot media..." message. Does anyone have any suggestions? My second question is how to label the boot options so that 1 says NanoBSD, 3 doesn't show up at all, and 5 days FreeBSD. -Pierre From owner-freebsd-fs@FreeBSD.ORG Mon May 31 11:06:55 2010 Return-Path: Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8ECFE106564A for ; Mon, 31 May 2010 11:06:55 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (unknown [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 7C3968FC08 for ; Mon, 31 May 2010 11:06:55 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o4VB6thY045983 for ; Mon, 31 May 2010 11:06:55 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o4VB6sYO045981 for freebsd-fs@FreeBSD.org; Mon, 31 May 2010 11:06:54 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 31 May 2010 11:06:54 GMT Message-Id: <201005311106.o4VB6sYO045981@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-fs@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-fs@FreeBSD.org X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2010 11:06:55 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/146708 fs [ufs] [panic] Kernel panic in softdep_disk_write_compl o kern/146528 fs [zfs] Severe memory leak in ZFS on i386 o kern/146502 fs [nfs] FreeBSD 8 NFS Client Connection to Server o kern/146375 fs [nfs] [patch] Typos in macro variables names in sys/fs o kern/145778 fs [zfs] [panic] panic in zfs_fuid_map_id (known issue fi s kern/145712 fs [zfs] cannot offline two drives in a raidz2 configurat s kern/145424 fs [zfs] [patch] move source closer to v15 o kern/145411 fs [xfs] [panic] Kernel panics shortly after mounting an o kern/145309 fs [disklabel]: Editing disk label invalidates the whole o kern/145272 fs [zfs] [panic] Panic during boot when accessing zfs on o kern/145246 fs [ufs] dirhash in 7.3 gratuitously frees hashes when it o kern/145238 fs [zfs] [panic] kernel panic on zpool clear tank o kern/145229 fs [zfs] Vast differences in ZFS ARC behavior between 8.0 o kern/145189 fs [nfs] nfsd performs abysmally under load o kern/144929 fs [ufs] [lor] vfs_bio.c + ufs_dirhash.c o kern/144458 fs [nfs] [patch] nfsd fails as a kld p kern/144447 fs [zfs] sharenfs fsunshare() & fsshare_main() non functi o kern/144416 fs [panic] Kernel panic on online filesystem optimization s kern/144415 fs [zfs] [panic] kernel panics on boot after zfs crash o kern/144234 fs [zfs] Cannot boot machine with recent gptzfsboot code o kern/143825 fs [nfs] [panic] Kernel panic on NFS client o kern/143345 fs [ext2fs] [patch] extfs minor header cleanups to better o kern/143212 fs [nfs] NFSv4 client strange work ... o kern/143184 fs [zfs] [lor] zfs/bufwait LOR o kern/142924 fs [ext2fs] [patch] Small cleanup for the inode struct in o kern/142914 fs [zfs] ZFS performance degradation over time o kern/142878 fs [zfs] [vfs] lock order reversal o kern/142597 fs [ext2fs] ext2fs does not work on filesystems with real o kern/142489 fs [zfs] [lor] allproc/zfs LOR o kern/142466 fs Update 7.2 -> 8.0 on Raid 1 ends with screwed raid [re o kern/142401 fs [ntfs] [patch] Minor updates to NTFS from NetBSD o kern/142306 fs [zfs] [panic] ZFS drive (from OSX Leopard) causes two o kern/142068 fs [ufs] BSD labels are got deleted spontaneously o kern/141897 fs [msdosfs] [panic] Kernel panic. msdofs: file name leng o kern/141463 fs [nfs] [panic] Frequent kernel panics after upgrade fro o kern/141305 fs [zfs] FreeBSD ZFS+sendfile severe performance issues ( o kern/141091 fs [patch] [nullfs] fix panics with DIAGNOSTIC enabled o kern/141086 fs [nfs] [panic] panic("nfs: bioread, not dir") on FreeBS o kern/141010 fs [zfs] "zfs scrub" fails when backed by files in UFS2 o kern/140888 fs [zfs] boot fail from zfs root while the pool resilveri o kern/140661 fs [zfs] [patch] /boot/loader fails to work on a GPT/ZFS- o kern/140640 fs [zfs] snapshot crash o kern/140134 fs [msdosfs] write and fsck destroy filesystem integrity o kern/140068 fs [smbfs] [patch] smbfs does not allow semicolon in file o kern/139725 fs [zfs] zdb(1) dumps core on i386 when examining zpool c o kern/139715 fs [zfs] vfs.numvnodes leak on busy zfs o bin/139651 fs [nfs] mount(8): read-only remount of NFS volume does n o kern/139597 fs [patch] [tmpfs] tmpfs initializes va_gen but doesn't u o kern/139564 fs [zfs] [panic] 8.0-RC1 - Fatal trap 12 at end of shutdo o kern/139407 fs [smbfs] [panic] smb mount causes system crash if remot o kern/139363 fs [nfs] diskless root nfs mount from non FreeBSD server o kern/138790 fs [zfs] ZFS ceases caching when mem demand is high o kern/138421 fs [ufs] [patch] remove UFS label limitations o kern/138202 fs mount_msdosfs(1) see only 2Gb f kern/137037 fs [zfs] [hang] zfs rollback on root causes FreeBSD to fr o kern/136968 fs [ufs] [lor] ufs/bufwait/ufs (open) o kern/136945 fs [ufs] [lor] filedesc structure/ufs (poll) o kern/136944 fs [ffs] [lor] bufwait/snaplk (fsync) o kern/136873 fs [ntfs] Missing directories/files on NTFS volume o kern/136865 fs [nfs] [patch] NFS exports atomic and on-the-fly atomic o kern/136470 fs [nfs] Cannot mount / in read-only, over NFS o kern/135546 fs [zfs] zfs.ko module doesn't ignore zpool.cache filenam o kern/135469 fs [ufs] [panic] kernel crash on md operation in ufs_dirb o kern/135050 fs [zfs] ZFS clears/hides disk errors on reboot o kern/134491 fs [zfs] Hot spares are rather cold... o kern/133676 fs [smbfs] [panic] umount -f'ing a vnode-based memory dis o kern/133614 fs [panic] panic: ffs_truncate: read-only filesystem o kern/133174 fs [msdosfs] [patch] msdosfs must support utf-encoded int f kern/133150 fs [zfs] Page fault with ZFS on 7.1-RELEASE/amd64 while w o kern/132960 fs [ufs] [panic] panic:ffs_blkfree: freeing free frag o kern/132397 fs reboot causes filesystem corruption (failure to sync b o kern/132331 fs [ufs] [lor] LOR ufs and syncer o kern/132237 fs [msdosfs] msdosfs has problems to read MSDOS Floppy o kern/132145 fs [panic] File System Hard Crashes o kern/131441 fs [unionfs] [nullfs] unionfs and/or nullfs not combineab o kern/131360 fs [nfs] poor scaling behavior of the NFS server under lo o kern/131342 fs [nfs] mounting/unmounting of disks causes NFS to fail o bin/131341 fs makefs: error "Bad file descriptor" on the mount poin o kern/130979 fs [smbfs] [panic] boot/kernel/smbfs.ko o kern/130920 fs [msdosfs] cp(1) takes 100% CPU time while copying file o kern/130229 fs [iconv] usermount fails on fs that need iconv o kern/130210 fs [nullfs] Error by check nullfs o kern/129760 fs [nfs] after 'umount -f' of a stale NFS share FreeBSD l o kern/129488 fs [smbfs] Kernel "bug" when using smbfs in smbfs_smb.c: o kern/129231 fs [ufs] [patch] New UFS mount (norandom) option - mostly o kern/129152 fs [panic] non-userfriendly panic when trying to mount(8) o kern/129059 fs [zfs] [patch] ZFS bootloader whitelistable via WITHOUT f kern/128829 fs smbd(8) causes periodic panic on 7-RELEASE o kern/127420 fs [gjournal] [panic] Journal overflow on gmirrored gjour o kern/127029 fs [panic] mount(8): trying to mount a write protected zi o kern/126287 fs [ufs] [panic] Kernel panics while mounting an UFS file o kern/125895 fs [ffs] [panic] kernel: panic: ffs_blkfree: freeing free s kern/125738 fs [zfs] [request] SHA256 acceleration in ZFS p kern/124621 fs [ext3] [patch] Cannot mount ext2fs partition f bin/124424 fs [zfs] zfs(8): zfs list -r shows strange snapshots' siz o kern/123939 fs [msdosfs] corrupts new files o kern/122380 fs [ffs] ffs_valloc:dup alloc (Soekris 4801/7.0/USB Flash o bin/122172 fs [fs]: amd(8) automount daemon dies on 6.3-STABLE i386, o bin/121898 fs [nullfs] pwd(1)/getcwd(2) fails with Permission denied o bin/121779 fs [ufs] snapinfo(8) (and related tools?) only work for t o bin/121366 fs [zfs] [patch] Automatic disk scrubbing from periodic(8 o bin/121072 fs [smbfs] mount_smbfs(8) cannot normally convert the cha f kern/120991 fs [panic] [fs] [snapshot] System crashes when manipulati o kern/120483 fs [ntfs] [patch] NTFS filesystem locking changes o kern/120482 fs [ntfs] [patch] Sync style changes between NetBSD and F f kern/119735 fs [zfs] geli + ZFS + samba starting on boot panics 7.0-B o kern/118912 fs [2tb] disk sizing/geometry problem with large array o kern/118713 fs [minidump] [patch] Display media size required for a k o bin/118249 fs mv(1): moving a directory changes its mtime o kern/118107 fs [ntfs] [panic] Kernel panic when accessing a file at N o bin/117315 fs [smbfs] mount_smbfs(8) and related options can't mount o kern/117314 fs [ntfs] Long-filename only NTFS fs'es cause kernel pani o kern/117158 fs [zfs] zpool scrub causes panic if geli vdevs detach on o bin/116980 fs [msdosfs] [patch] mount_msdosfs(8) resets some flags f o conf/116931 fs lack of fsck_cd9660 prevents mounting iso images with o kern/116913 fs [ffs] [panic] ffs_blkfree: freeing free block p kern/116608 fs [msdosfs] [patch] msdosfs fails to check mount options o kern/116583 fs [ffs] [hang] System freezes for short time when using o kern/116170 fs [panic] Kernel panic when mounting /tmp o kern/115645 fs [snapshots] [panic] lockmgr: thread 0xc4c00d80, not ex o bin/115361 fs [zfs] mount(8) gets into a state where it won't set/un o kern/114955 fs [cd9660] [patch] [request] support for mask,dirmask,ui o kern/114847 fs [ntfs] [patch] [request] dirmask support for NTFS ala o kern/114676 fs [ufs] snapshot creation panics: snapacct_ufs2: bad blo o bin/114468 fs [patch] [request] add -d option to umount(8) to detach o kern/113852 fs [smbfs] smbfs does not properly implement DFS referral o bin/113838 fs [patch] [request] mount(8): add support for relative p o bin/113049 fs [patch] [request] make quot(8) use getopt(3) and show o kern/112658 fs [smbfs] [patch] smbfs and caching problems (resolves b o kern/111843 fs [msdosfs] Long Names of files are incorrectly created o kern/111782 fs [ufs] dump(8) fails horribly for large filesystems s bin/111146 fs [2tb] fsck(8) fails on 6T filesystem o kern/109024 fs [msdosfs] mount_msdosfs: msdosfs_iconv: Operation not o kern/109010 fs [msdosfs] can't mv directory within fat32 file system o bin/107829 fs [2TB] fdisk(8): invalid boundary checking in fdisk / w o kern/106107 fs [ufs] left-over fsck_snapshot after unfinished backgro o kern/106030 fs [ufs] [panic] panic in ufs from geom when a dead disk o kern/104406 fs [ufs] Processes get stuck in "ufs" state under persist o kern/104133 fs [ext2fs] EXT2FS module corrupts EXT2/3 filesystems o kern/103035 fs [ntfs] Directories in NTFS mounted disc images appear o kern/101324 fs [smbfs] smbfs sometimes not case sensitive when it's s o kern/99290 fs [ntfs] mount_ntfs ignorant of cluster sizes o kern/97377 fs [ntfs] [patch] syntax cleanup for ntfs_ihash.c o kern/95222 fs [iso9660] File sections on ISO9660 level 3 CDs ignored o kern/94849 fs [ufs] rename on UFS filesystem is not atomic o kern/94769 fs [ufs] Multiple file deletions on multi-snapshotted fil o kern/94733 fs [smbfs] smbfs may cause double unlock o kern/93942 fs [vfs] [patch] panic: ufs_dirbad: bad dir (patch from D o kern/92272 fs [ffs] [hang] Filling a filesystem while creating a sna f kern/91568 fs [ufs] [panic] writing to UFS/softupdates DVD media in o kern/91134 fs [smbfs] [patch] Preserve access and modification time a kern/90815 fs [smbfs] [patch] SMBFS with character conversions somet o kern/88657 fs [smbfs] windows client hang when browsing a samba shar o kern/88266 fs [smbfs] smbfs does not implement UIO_NOCOPY and sendfi o kern/87859 fs [smbfs] System reboot while umount smbfs. o kern/86587 fs [msdosfs] rm -r /PATH fails with lots of small files o kern/85326 fs [smbfs] [panic] saving a file via samba to an overquot o kern/84589 fs [2TB] 5.4-STABLE unresponsive during background fsck 2 o kern/80088 fs [smbfs] Incorrect file time setting on NTFS mounted vi o kern/73484 fs [ntfs] Kernel panic when doing `ls` from the client si o bin/73019 fs [ufs] fsck_ufs(8) cannot alloc 607016868 bytes for ino o kern/71774 fs [ntfs] NTFS cannot "see" files on a WinXP filesystem o kern/68978 fs [panic] [ufs] crashes with failing hard disk, loose po o kern/65920 fs [nwfs] Mounted Netware filesystem behaves strange o kern/65901 fs [smbfs] [patch] smbfs fails fsx write/truncate-down/tr o kern/61503 fs [smbfs] mount_smbfs does not work as non-root o kern/55617 fs [smbfs] Accessing an nsmb-mounted drive via a smb expo o kern/53137 fs [ffs] [panic] background fscking causing ffs_valloc pa o kern/51685 fs [hang] Unbounded inode allocation causes kernel to loc o kern/51583 fs [nullfs] [patch] allow to work with devices and socket o kern/36566 fs [smbfs] System reboot with dead smb mount and umount o kern/33464 fs [ufs] soft update inconsistencies after system crash o kern/18874 fs [2TB] 32bit NFS servers export wrong negative values t 173 problems total. From owner-freebsd-fs@FreeBSD.ORG Mon May 31 16:54:28 2010 Return-Path: Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76FFD106564A for ; Mon, 31 May 2010 16:54:28 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id BF19E8FC15 for ; Mon, 31 May 2010 16:54:27 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA05565 for ; Mon, 31 May 2010 19:54:25 +0300 (EEST) (envelope-from avg@icyb.net.ua) Message-ID: <4C03E9C0.2010602@icyb.net.ua> Date: Mon, 31 May 2010 19:54:24 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100517) MIME-Version: 1.0 To: freebsd-fs@FreeBSD.org X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Subject: nullfs distinct path check: take into account filesystems X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2010 16:54:28 -0000 Right now mount_nullfs doesn't allow to, for example, mount / in /tmp/somedir even if /tmp is a different filesystem. I think there is no reason to do that and thus propose the following patch. diff --git a/sbin/mount_nullfs/mount_nullfs.c b/sbin/mount_nullfs/mount_nullfs.c index abca9fa..4bd426f 100644 --- a/sbin/mount_nullfs/mount_nullfs.c +++ b/sbin/mount_nullfs/mount_nullfs.c @@ -46,6 +46,7 @@ static const char rcsid[] = #include #include +#include #include #include @@ -62,7 +63,8 @@ struct mntopt mopts[] = { MOPT_END }; -int subdir(const char *, const char *); +static int samefs(const char *p1, const char *p2); +static int subdir(const char *, const char *); static void usage(void) __dead2; int @@ -93,7 +95,8 @@ main(int argc, char *argv[]) (void)checkpath(argv[0], target); (void)checkpath(argv[1], source); - if (subdir(target, source) || subdir(source, target)) + if (samefs(target, source) + && (subdir(target, source) || subdir(source, target))) errx(EX_USAGE, "%s (%s) and %s are not distinct paths", argv[0], target, argv[1]); @@ -116,6 +119,21 @@ main(int argc, char *argv[]) } int +samefs(const char *p1, const char *p2) +{ + struct stat sb; + uint32_t fsid1; + uint32_t fsid2; + + stat(p1, &sb); + fsid1 = sb.st_dev; + stat(p2, &sb); + fsid2 = sb.st_dev; + + return (fsid1 == fsid2); +} + +int subdir(const char *p, const char *dir) { int l; -- Andriy Gapon From owner-freebsd-fs@FreeBSD.ORG Mon May 31 23:32:54 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51CA6106566C for ; Mon, 31 May 2010 23:32:54 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello089077043238.chello.pl [89.77.43.238]) by mx1.freebsd.org (Postfix) with ESMTP id C9D738FC14 for ; Mon, 31 May 2010 23:32:53 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 242BC45CDD; Tue, 1 Jun 2010 01:32:51 +0200 (CEST) Received: from localhost (chello089077043238.chello.pl [89.77.43.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 847E945C98; Tue, 1 Jun 2010 01:32:44 +0200 (CEST) Date: Tue, 1 Jun 2010 01:32:41 +0200 From: Pawel Jakub Dawidek To: Eugene Mitrofanov Message-ID: <20100531233241.GB2066@garage.freebsd.pl> References: <201005211555.59622.eugene@imedia.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3uo+9/B/ebqu+fSQ" Content-Disposition: inline In-Reply-To: <201005211555.59622.eugene@imedia.ru> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: freebsd-fs@freebsd.org, freebsd-questions@freebsd.org Subject: Re: FreeBSD 8.1-PRERELEASE: property 'jailed' not supported on FreeBSD: permission denied X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2010 23:32:54 -0000 --3uo+9/B/ebqu+fSQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 21, 2010 at 03:55:59PM +0400, Eugene Mitrofanov wrote: > Hi >=20 > The command "zfs set jailed=3Don tank/s1" is failed with the message " > property 'jailed' not supported on FreeBSD: permission denied". >=20 > Output of "zfs get jailed tank/s1" shows me that the property "jailed" is= =20 > still exists: > NAME PROPERTY VALUE SOURCE > tank/s1 jailed off default >=20 > How can I change its value? It was accidentally marked as OpenSolaris-specific. Should be fixed as of r208684 in HEAD and I plan to merge it to stable/8 in few days. Thanks for the report! --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --3uo+9/B/ebqu+fSQ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkwERxgACgkQForvXbEpPzRYQQCfcK5PcVyL6QxZrMt78rSONXjW seUAoKLiUtNhcHcTMgMz/RKR9aRuBMP+ =cQM1 -----END PGP SIGNATURE----- --3uo+9/B/ebqu+fSQ-- From owner-freebsd-fs@FreeBSD.ORG Tue Jun 1 00:44:55 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03678106566B; Tue, 1 Jun 2010 00:44:55 +0000 (UTC) (envelope-from jamesbrandongooch@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id A2AA88FC12; Tue, 1 Jun 2010 00:44:54 +0000 (UTC) Received: by iwn5 with SMTP id 5so680657iwn.13 for ; Mon, 31 May 2010 17:44:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=85gkVL7ApPoXCjPfxfz6qXmmO4rJpKhYH16U3vnD0Ls=; b=uriIzN0/LDNPp9mVuFJdbCwF/HHi8YHQGLi93jiHF/QQImEW8i9NKakjIUHmZA0zWo wLnC2Lri+XQyl287fRULbTaLdtUDvrGdG1/LqNc4BRFfvxip4yCQIOcORQUg558HHaST LHjalOfFs73ziohFGs/P6EeHdKLnSebfySG0k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=cmLn2uAbUmsDfXWyoAnb+/g+f8ZLOlKFnZPfr0hnioRnctolV3oeFIduMpH60oDo7l eDecpq0jZFQgZg++WbwOEEQckobA6P8Gm7Iydsams4n3HDYYkM1hiAuA6HyMkOls6Y02 yNGW7sxvwGijYFiyYilcn6SkMBrNeV2ujbMAs= MIME-Version: 1.0 Received: by 10.231.176.16 with SMTP id bc16mr6792952ibb.4.1275353093787; Mon, 31 May 2010 17:44:53 -0700 (PDT) Received: by 10.231.182.204 with HTTP; Mon, 31 May 2010 17:44:53 -0700 (PDT) In-Reply-To: <20100531233241.GB2066@garage.freebsd.pl> References: <201005211555.59622.eugene@imedia.ru> <20100531233241.GB2066@garage.freebsd.pl> Date: Mon, 31 May 2010 19:44:53 -0500 Message-ID: From: Brandon Gooch To: Pawel Jakub Dawidek Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-fs@freebsd.org, freebsd-questions@freebsd.org Subject: Re: FreeBSD 8.1-PRERELEASE: property 'jailed' not supported on FreeBSD: permission denied X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2010 00:44:55 -0000 On Mon, May 31, 2010 at 6:32 PM, Pawel Jakub Dawidek wrot= e: > On Fri, May 21, 2010 at 03:55:59PM +0400, Eugene Mitrofanov wrote: >> Hi >> >> The command "zfs set jailed=3Don tank/s1" is failed with the message " >> property 'jailed' not supported on FreeBSD: permission denied". >> >> Output of "zfs get jailed tank/s1" shows me that the property "jailed" i= s >> still exists: >> NAME =A0 =A0 PROPERTY =A0VALUE =A0 =A0SOURCE >> tank/s1 =A0jailed =A0 =A0off =A0 =A0 =A0default >> >> How can I change its value? > > It was accidentally marked as OpenSolaris-specific. > > Should be fixed as of r208684 in HEAD and I plan to merge it to stable/8 > in few days. > > Thanks for the report! I discovered this just last night (May 30, 2010) -- will it be able to be pushed into 8.1-RELEASE? It's important in my ezjail setups... -Brandon From owner-freebsd-fs@FreeBSD.ORG Tue Jun 1 13:58:02 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B84231065675 for ; Tue, 1 Jun 2010 13:58:02 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 469B98FC12 for ; Tue, 1 Jun 2010 13:58:01 +0000 (UTC) Received: by fxm5 with SMTP id 5so3653949fxm.13 for ; Tue, 01 Jun 2010 06:58:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:organization :date:message-id:user-agent:mime-version:content-type; bh=hxb23l3u3Z3N96b880WLJAGTrDt4vtFMhkYFloq8mkc=; b=d/dhccJPShVlinEw1VsUCM0daAPbxT2cjY1z2Mc6pXEfm4z3N2u/vXyTZjNvQEjd80 W0+S4D4TUAUw5sAFUeeIQxOfhzY7ym3dpW2ItSp4lP3LvZAzggIYhDCbXD75jp0QyQUT joksiZxmYy5w1fVa7vSBfvv5Chi8FJhNImIAU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:organization:date:message-id:user-agent :mime-version:content-type; b=Wu2fXQYdqWNZZRrf0ut+3QygANvAttW3nsBEbNFCB5+xTLWFDsUGYSnIOyjUvw5fyA fD5H3SJZ0+8QqOp714ujrtYpQzqfOxFvaGgvDtrq+7O0PvQC8aqEj2GaD/k+nuIYrZxb /5syboxsu8I0xa1gJIfGds2y2QDJFGPdnuoU0= Received: by 10.204.148.69 with SMTP id o5mr688919bkv.188.1275400680736; Tue, 01 Jun 2010 06:58:00 -0700 (PDT) Received: from localhost (ua1.etadirect.net [91.198.140.16]) by mx.google.com with ESMTPS id v3sm3264433bkz.10.2010.06.01.06.57.59 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 01 Jun 2010 06:57:59 -0700 (PDT) From: Mikolaj Golub To: freebsd-fs@FreeBSD.org Organization: TOA Ukraine Date: Tue, 01 Jun 2010 16:57:57 +0300 Message-ID: <86fx16onx6.fsf@zhuzha.ua1> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Subject: nullfs: vop_rename: fdvp is locked but should not be X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2010 13:58:02 -0000 Hi, Having a kernel compiled with DEBUG_VFS_LOCKS and doing something like below: mount -t nullfs /tmp/1 /tmp/2 mv /tmp/1/test.file /tmp/2/ I have a panic (checked on 8-STABLE and CURRENT): vop_rename: fdvp locked: 0xc70c82b0 is locked but should not be KDB: enter: lock violation (kgdb) bt #0 doadump () at pcpu.h:246 #1 0xc04ed519 in db_fncall (dummy1=1, dummy2=0, dummy3=-1056863104, dummy4=0xe858a8d4 "") at /usr/src/sys/ddb/db_command.c:548 #2 0xc04ed911 in db_command (last_cmdp=0xc0e195dc, cmd_table=0x0, dopager=1) at /usr/src/sys/ddb/db_command.c:445 #3 0xc04eda6a in db_command_loop () at /usr/src/sys/ddb/db_command.c:498 #4 0xc04ef90d in db_trap (type=3, code=0) at /usr/src/sys/ddb/db_main.c:229 #5 0xc08e9f66 in kdb_trap (type=3, code=0, tf=0xe858aa7c) at /usr/src/sys/kern/subr_kdb.c:535 #6 0xc0bfcc3b in trap (frame=0xe858aa7c) at /usr/src/sys/i386/i386/trap.c:690 #7 0xc0bddffb in calltrap () at /usr/src/sys/i386/i386/exception.s:165 #8 0xc08ea0ea in kdb_enter (why=0xc0ce2dbf "vfslock", msg=0xc0ce2db0 "lock violation") at cpufunc.h:71 #9 0xc094a881 in vfs_badlock (msg=0xc0ce2ddc "is locked but should not be", str=0xc0ce38b9 "vop_rename: fdvp locked", vp=0xc70c82b0) at /usr/src/sys/kern/vfs_subr.c:3701 #10 0xc094e4f5 in assert_vop_unlocked (vp=0xc70c82b0, str=0xc0ce38b9 "vop_rename: fdvp locked") at /usr/src/sys/kern/vfs_subr.c:3733 #11 0xc094e7d7 in vop_rename_pre (ap=0xe858ac1c) at /usr/src/sys/kern/vfs_subr.c:3792 #12 0xc0c16a46 in VOP_RENAME_APV (vop=0xc0df8960, a=0xe858ac1c) at vnode_if.c:1472 #13 0xc0956d47 in kern_renameat (td=0xc6596a00, oldfd=-100, old=0xbfbfe953
, newfd=-100, new=0xbfbfe968
, pathseg=UIO_USERSPACE) at vnode_if.h:636 #14 0xc0956ef6 in kern_rename (td=0xc6596a00, from=0xbfbfe953
, to=0xbfbfe968
, pathseg=UIO_USERSPACE) at /usr/src/sys/kern/vfs_syscalls.c:3569 #15 0xc0956f29 in rename (td=0xc6596a00, uap=0xe858acf8) at /usr/src/sys/kern/vfs_syscalls.c:3546 #16 0xc0bfc370 in syscall (frame=0xe858ad38) at /usr/src/sys/i386/i386/trap.c:1111 #17 0xc0bde090 in Xint0x80_syscall () at /usr/src/sys/i386/i386/exception.s:261 #18 0x00000033 in ?? () Previous frame inner to this frame (corrupt stack?) (kgdb) fr 11 #11 0xc094e7d7 in vop_rename_pre (ap=0xe858ac1c) at /usr/src/sys/kern/vfs_subr.c:3792 3792 ASSERT_VOP_UNLOCKED(a->a_fdvp, "vop_rename: fdvp locked"); (kgdb) list 3787 ASSERT_VI_UNLOCKED(a->a_fvp, "VOP_RENAME"); 3788 ASSERT_VI_UNLOCKED(a->a_fdvp, "VOP_RENAME"); 3789 3790 /* Check the source (from). */ 3791 if (a->a_tdvp != a->a_fdvp && a->a_tvp != a->a_fdvp) 3792 ASSERT_VOP_UNLOCKED(a->a_fdvp, "vop_rename: fdvp locked"); 3793 if (a->a_tvp != a->a_fvp) 3794 ASSERT_VOP_UNLOCKED(a->a_fvp, "vop_rename: fvp locked"); 3795 3796 /* Check the target. */ On kernels without DEBUG_VFS_LOCKS it looks like mv does not cause any problems, although the behavior differs from moving the file to itself on ufs: on ufs the file remains unchanged, while when moving like in the example above the file disappears. So, do we have false ASSERT here and additional check should be performed before calling ASSERT_VOP_UNLOCKED(), e.g. checking that ((struct null_node*)(a->a_fdvp->v_data))->null_lowervp != a->a_fdvp? Is this worth adding such check? -- Mikolaj Golub From owner-freebsd-fs@FreeBSD.ORG Tue Jun 1 14:07:27 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EB2C1065670 for ; Tue, 1 Jun 2010 14:07:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id BC8008FC14 for ; Tue, 1 Jun 2010 14:07:26 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o51E7Yjo074022 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 1 Jun 2010 17:07:34 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o51E7Llh090993; Tue, 1 Jun 2010 17:07:21 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o51E7LEq090992; Tue, 1 Jun 2010 17:07:21 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 1 Jun 2010 17:07:21 +0300 From: Kostik Belousov To: Mikolaj Golub Message-ID: <20100601140721.GH83316@deviant.kiev.zoral.com.ua> References: <86fx16onx6.fsf@zhuzha.ua1> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Tig5KXJwt3YyVVnR" Content-Disposition: inline In-Reply-To: <86fx16onx6.fsf@zhuzha.ua1> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-fs@freebsd.org Subject: Re: nullfs: vop_rename: fdvp is locked but should not be X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2010 14:07:27 -0000 --Tig5KXJwt3YyVVnR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 01, 2010 at 04:57:57PM +0300, Mikolaj Golub wrote: > Hi, >=20 > Having a kernel compiled with DEBUG_VFS_LOCKS and doing something like be= low: >=20 > mount -t nullfs /tmp/1 /tmp/2=20 > mv /tmp/1/test.file /tmp/2/ cp /tmp/1/test.file /tmp/2/test.file is even more spectacular, but is the different story. >=20 > I have a panic (checked on 8-STABLE and CURRENT): >=20 > vop_rename: fdvp locked: 0xc70c82b0 is locked but should not be > KDB: enter: lock violation >=20 > (kgdb) bt > #0 doadump () at pcpu.h:246 > #1 0xc04ed519 in db_fncall (dummy1=3D1, dummy2=3D0, dummy3=3D-1056863104= , dummy4=3D0xe858a8d4 "") > at /usr/src/sys/ddb/db_command.c:548 > #2 0xc04ed911 in db_command (last_cmdp=3D0xc0e195dc, cmd_table=3D0x0, do= pager=3D1) > at /usr/src/sys/ddb/db_command.c:445 > #3 0xc04eda6a in db_command_loop () at /usr/src/sys/ddb/db_command.c:498 > #4 0xc04ef90d in db_trap (type=3D3, code=3D0) at /usr/src/sys/ddb/db_mai= n.c:229 > #5 0xc08e9f66 in kdb_trap (type=3D3, code=3D0, tf=3D0xe858aa7c) at /usr/= src/sys/kern/subr_kdb.c:535 > #6 0xc0bfcc3b in trap (frame=3D0xe858aa7c) at /usr/src/sys/i386/i386/tra= p.c:690 > #7 0xc0bddffb in calltrap () at /usr/src/sys/i386/i386/exception.s:165 > #8 0xc08ea0ea in kdb_enter (why=3D0xc0ce2dbf "vfslock", msg=3D0xc0ce2db0= "lock violation") at cpufunc.h:71 > #9 0xc094a881 in vfs_badlock (msg=3D0xc0ce2ddc "is locked but should not= be",=20 > str=3D0xc0ce38b9 "vop_rename: fdvp locked", vp=3D0xc70c82b0) at /usr/= src/sys/kern/vfs_subr.c:3701 > #10 0xc094e4f5 in assert_vop_unlocked (vp=3D0xc70c82b0, str=3D0xc0ce38b9 = "vop_rename: fdvp locked") > at /usr/src/sys/kern/vfs_subr.c:3733 > #11 0xc094e7d7 in vop_rename_pre (ap=3D0xe858ac1c) at /usr/src/sys/kern/v= fs_subr.c:3792 > #12 0xc0c16a46 in VOP_RENAME_APV (vop=3D0xc0df8960, a=3D0xe858ac1c) at vn= ode_if.c:1472 > #13 0xc0956d47 in kern_renameat (td=3D0xc6596a00, oldfd=3D-100,=20 > old=3D0xbfbfe953
, newfd=3D-100,=20 > new=3D0xbfbfe968
, pathseg=3DUIO_US= ERSPACE) at vnode_if.h:636 > #14 0xc0956ef6 in kern_rename (td=3D0xc6596a00, from=3D0xbfbfe953 ,=20 > to=3D0xbfbfe968
, pathseg=3DUIO_USE= RSPACE) > at /usr/src/sys/kern/vfs_syscalls.c:3569 > #15 0xc0956f29 in rename (td=3D0xc6596a00, uap=3D0xe858acf8) at /usr/src/= sys/kern/vfs_syscalls.c:3546 > #16 0xc0bfc370 in syscall (frame=3D0xe858ad38) at /usr/src/sys/i386/i386/= trap.c:1111 > #17 0xc0bde090 in Xint0x80_syscall () at /usr/src/sys/i386/i386/exception= .s:261 > #18 0x00000033 in ?? () > Previous frame inner to this frame (corrupt stack?) > (kgdb) fr 11 > #11 0xc094e7d7 in vop_rename_pre (ap=3D0xe858ac1c) at /usr/src/sys/kern/v= fs_subr.c:3792 > 3792 ASSERT_VOP_UNLOCKED(a->a_fdvp, "vop_rename: fdvp = locked"); > (kgdb) list > 3787 ASSERT_VI_UNLOCKED(a->a_fvp, "VOP_RENAME"); > 3788 ASSERT_VI_UNLOCKED(a->a_fdvp, "VOP_RENAME"); > 3789 > 3790 /* Check the source (from). */ > 3791 if (a->a_tdvp !=3D a->a_fdvp && a->a_tvp !=3D a->a_fdvp) > 3792 ASSERT_VOP_UNLOCKED(a->a_fdvp, "vop_rename: fdvp = locked"); > 3793 if (a->a_tvp !=3D a->a_fvp) > 3794 ASSERT_VOP_UNLOCKED(a->a_fvp, "vop_rename: fvp lo= cked"); > 3795 > 3796 /* Check the target. */ >=20 > On kernels without DEBUG_VFS_LOCKS it looks like mv does not cause any > problems, although the behavior differs from moving the file to itself on= ufs: > on ufs the file remains unchanged, while when moving like in the example = above > the file disappears. >=20 > So, do we have false ASSERT here and additional check should be performed > before calling ASSERT_VOP_UNLOCKED(), e.g. checking that >=20 > ((struct null_node*)(a->a_fdvp->v_data))->null_lowervp !=3D a->a_fdvp? >=20 > Is this worth adding such check? I am curious to look at the final patch. Note that you proposing to add fs-specific check to vfs_subr.c. Checking that the the vnode locks are different instead of that vnodes itself are different might be better approach for vop_rename_pre. --Tig5KXJwt3YyVVnR Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkwFFBkACgkQC3+MBN1Mb4jlcwCdFXZQnk/fPdrpX6P1xe5Bl8ik p88AoJsE9mky1vU4FleX0h93muiRzhlR =TrO7 -----END PGP SIGNATURE----- --Tig5KXJwt3YyVVnR-- From owner-freebsd-fs@FreeBSD.ORG Tue Jun 1 19:06:49 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B9C3106567A for ; Tue, 1 Jun 2010 19:06:49 +0000 (UTC) (envelope-from gleb.kurtsou@gmail.com) Received: from mail-ew0-f209.google.com (mail-ew0-f209.google.com [209.85.219.209]) by mx1.freebsd.org (Postfix) with ESMTP id 9C6CC8FC22 for ; Tue, 1 Jun 2010 19:06:48 +0000 (UTC) Received: by ewy1 with SMTP id 1so1389374ewy.33 for ; Tue, 01 Jun 2010 12:06:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=vLPztj8QW2BHezYjwzSh/ZaP+L6BY6s89gs8mh5Au1k=; b=SlIGnkiWcHsIPYzCQcWyw/tD2OMaXncux0kOFoXUoMb3t2Ki/UoMX4tbTc4vaA2Io9 Krhmts+IN8SyLhTCcC2mlW5S9PnlqCZbQsNzCe7Kadp+IKtMaQtE2oYc7LP+IJ38G7UM z9kQ0CeBKhotHHAPfbVXWxAdPZfWXQuDCCSV4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=HqaG9R8X1iziaYqBBL1shTsDYbbCtWtR+iqkebYh4PD0LjYf5eXoiVczSHX42RBRJr gA+5p16S5pZQMgHPh5NrJII4hTAikBlsBV1rFeX2SETJwYBoELcF4/2P+AbPK6Hi/7/e YmqAU8eJvHtp1h5hRF8hrKZa+XVIExCXIfaFk= Received: by 10.213.32.197 with SMTP id e5mr3854336ebd.28.1275419207363; Tue, 01 Jun 2010 12:06:47 -0700 (PDT) Received: from localhost (lan-78-157-90-54.vln.skynet.lt [78.157.90.54]) by mx.google.com with ESMTPS id 15sm3921972ewy.0.2010.06.01.12.06.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 01 Jun 2010 12:06:45 -0700 (PDT) Date: Tue, 1 Jun 2010 22:06:58 +0300 From: Gleb Kurtsou To: Andriy Gapon Message-ID: <20100601190658.GA2594@tops.skynet.lt> References: <4C03E9C0.2010602@icyb.net.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4C03E9C0.2010602@icyb.net.ua> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-fs@FreeBSD.org Subject: Re: nullfs distinct path check: take into account filesystems X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2010 19:06:49 -0000 On (31/05/2010 19:54), Andriy Gapon wrote: > > Right now mount_nullfs doesn't allow to, for example, mount / in /tmp/somedir even > if /tmp is a different filesystem. > I think there is no reason to do that and thus propose the following patch. Why don't we remove mount_nullfs entirely? Such check is trivial to do in kernel, all is needed is to change mntopts and add compatibility shims. Take a look at pefs_mount if interested: http://github.com/glk/pefs/blob/master/sys/fs/pefs/pefs_vfsops.c There is no mount_pefs and 'pefs mount' command exec's /sbin/mount, 'mount -t pefs' is supported as well; search for pefs_mount in: http://github.com/glk/pefs/blob/master/sbin/pefs/pefs_ctl.c Thanks, Gleb. > > diff --git a/sbin/mount_nullfs/mount_nullfs.c b/sbin/mount_nullfs/mount_nullfs.c > index abca9fa..4bd426f 100644 > --- a/sbin/mount_nullfs/mount_nullfs.c > +++ b/sbin/mount_nullfs/mount_nullfs.c > @@ -46,6 +46,7 @@ static const char rcsid[] = > > #include > #include > +#include > #include > > #include > @@ -62,7 +63,8 @@ struct mntopt mopts[] = { > MOPT_END > }; > > -int subdir(const char *, const char *); > +static int samefs(const char *p1, const char *p2); > +static int subdir(const char *, const char *); > static void usage(void) __dead2; > > int > @@ -93,7 +95,8 @@ main(int argc, char *argv[]) > (void)checkpath(argv[0], target); > (void)checkpath(argv[1], source); > > - if (subdir(target, source) || subdir(source, target)) > + if (samefs(target, source) > + && (subdir(target, source) || subdir(source, target))) > errx(EX_USAGE, "%s (%s) and %s are not distinct paths", > argv[0], target, argv[1]); > > @@ -116,6 +119,21 @@ main(int argc, char *argv[]) > } > > int > +samefs(const char *p1, const char *p2) > +{ > + struct stat sb; > + uint32_t fsid1; > + uint32_t fsid2; > + > + stat(p1, &sb); > + fsid1 = sb.st_dev; > + stat(p2, &sb); > + fsid2 = sb.st_dev; > + > + return (fsid1 == fsid2); > +} > + > +int > subdir(const char *p, const char *dir) > { > int l; > > -- > Andriy Gapon > _______________________________________________ > freebsd-fs@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-fs > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org" From owner-freebsd-fs@FreeBSD.ORG Tue Jun 1 19:13:35 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76532106566B; Tue, 1 Jun 2010 19:13:35 +0000 (UTC) (envelope-from freebsd@bitfreak.org) Received: from baumren.bluerosetech.com (baumren.bluerosetech.com [69.55.234.33]) by mx1.freebsd.org (Postfix) with ESMTP id 43D3C8FC19; Tue, 1 Jun 2010 19:13:35 +0000 (UTC) Received: from vivi.cat.pdx.edu (vivi.cat.pdx.edu [131.252.214.6]) by baumren.bluerosetech.com (Postfix) with ESMTPSA id EFC2ECF889; Tue, 1 Jun 2010 11:55:13 -0700 (PDT) Received: from [IPv6:2001:470:8244:970:d978:ff31:cfda:924e] (unknown [IPv6:2001:470:8244:970:d978:ff31:cfda:924e]) by vivi.cat.pdx.edu (Postfix) with ESMTPSA id CA02724DFE; Tue, 1 Jun 2010 11:55:11 -0700 (PDT) Message-ID: <4C05577F.7040001@bitfreak.org> Date: Tue, 01 Jun 2010 11:54:55 -0700 From: Darren Pilgrim User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Jeremy Chadwick References: <060401cafe37$a411b240$ec3516c0$@net> <4BFF894F.4010008@icyb.net.ua> <20100528134549.GA75411@icarus.home.lan> In-Reply-To: <20100528134549.GA75411@icarus.home.lan> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: amd64@freebsd.org, freebsd-fs@freebsd.org Subject: Re: FreeBSD 8.1-Prerelease Panic amd64 w/ZFS.. X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2010 19:13:35 -0000 Jeremy Chadwick wrote: > To the OP: you will need to increase vm.kmem_size in /boot/loader.conf > and reboot the system. "What value do I pick?" With 4GB, I would > recommend you use these two variables: > > vm.kmem_size="2048M" > vfs.zfs.arc_max="1536M" > > This will increase the available kmem, and also limit the ARC size > explicitly to nothing larger than 1.5GB. This should stabilise your > system. What are the general guidelines for sizing these given the amount of physical RAM? For example, I have a machine with 6 GB, so I have: vm.kmem_size="3072M" vfs.zfs.arc_max="2048M" From owner-freebsd-fs@FreeBSD.ORG Tue Jun 1 19:23:47 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20A28106567B for ; Tue, 1 Jun 2010 19:23:47 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from qmta14.westchester.pa.mail.comcast.net (qmta14.westchester.pa.mail.comcast.net [76.96.59.212]) by mx1.freebsd.org (Postfix) with ESMTP id C08C68FC15 for ; Tue, 1 Jun 2010 19:23:45 +0000 (UTC) Received: from omta03.westchester.pa.mail.comcast.net ([76.96.62.27]) by qmta14.westchester.pa.mail.comcast.net with comcast id QafB1e0040bG4ec5EjPlJs; Tue, 01 Jun 2010 19:23:46 +0000 Received: from koitsu.dyndns.org ([98.248.46.159]) by omta03.westchester.pa.mail.comcast.net with comcast id QjPk1e00U3S48mS3PjPlqc; Tue, 01 Jun 2010 19:23:45 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 461E69B418; Tue, 1 Jun 2010 12:23:43 -0700 (PDT) Date: Tue, 1 Jun 2010 12:23:43 -0700 From: Jeremy Chadwick To: Darren Pilgrim Message-ID: <20100601192343.GA44238@icarus.home.lan> References: <060401cafe37$a411b240$ec3516c0$@net> <4BFF894F.4010008@icyb.net.ua> <20100528134549.GA75411@icarus.home.lan> <4C05577F.7040001@bitfreak.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C05577F.7040001@bitfreak.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: amd64@freebsd.org, freebsd-fs@freebsd.org Subject: Re: FreeBSD 8.1-Prerelease Panic amd64 w/ZFS.. X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2010 19:23:47 -0000 On Tue, Jun 01, 2010 at 11:54:55AM -0700, Darren Pilgrim wrote: > Jeremy Chadwick wrote: > >To the OP: you will need to increase vm.kmem_size in /boot/loader.conf > >and reboot the system. "What value do I pick?" With 4GB, I would > >recommend you use these two variables: > > > >vm.kmem_size="2048M" > >vfs.zfs.arc_max="1536M" > > > >This will increase the available kmem, and also limit the ARC size > >explicitly to nothing larger than 1.5GB. This should stabilise your > >system. > > What are the general guidelines for sizing these given the amount of > physical RAM? For example, I have a machine with 6 GB, so I have: > > vm.kmem_size="3072M" > vfs.zfs.arc_max="2048M" There really aren't any, as far as I know, since it depends on each system, it's role, and what architecture type (i386 vs. amd64). I'm focusing solely on amd64. Method I tend to follow: vm.kmem_size = 1/2 of available RAM (think physical/installed) vfs.zfs.arc_max = vm.kmem_size minus 512MB I believe there were some reported cases of panics on systems with vm.kmem_size == vfs.zfs.arc_max, but I could be remembering incorrectly. There's too many posts/people to remember who said what and when. I think there's a kstat.zfs.misc.arcstats sysctl counter which tracks the maximum ARC ever used, but could be mistaken here too. One of our 8GB systems that uses ZFS also runs MySQL, which requires me to use these values in addition to the above. Note that, AFAIK, the below values *do not* affect ZFS directly; I'm pointing them out as necessities, else a "heavy" mysqld crashes and complains about there not being enough memory (directly correlating to maxdsiz). kern.maxdsiz="1536M" kern.dfldsiz="1536M" kern.maxssiz="256M" Rather than try to pick values that "all add up to 8GB" (don't do this), I leave a lot of extra space for other things (kernel bits, network buffers, blah blah) that I don't want to think about. I try to avoid being OCD with tuning unless I have reason to be. All I really care about is providing enough memory for userland daemons and ZFS to run reliably/not panic the box. I'd welcome the community and developers to chime in here, especially folks familiar with the VM and how all of these tunables interact with one another. -- | Jeremy Chadwick jdc@parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB | From owner-freebsd-fs@FreeBSD.ORG Tue Jun 1 19:54:42 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CD86106566C for ; Tue, 1 Jun 2010 19:54:42 +0000 (UTC) (envelope-from korvus@comcast.net) Received: from mx04.pub.collaborativefusion.com (mx04.pub.collaborativefusion.com [206.210.72.84]) by mx1.freebsd.org (Postfix) with ESMTP id D96628FC12 for ; Tue, 1 Jun 2010 19:54:41 +0000 (UTC) Received: from [192.168.2.164] ([206.210.89.202]) by mx04.pub.collaborativefusion.com (StrongMail Enterprise 4.1.1.4(4.1.1.4-47689)); Tue, 01 Jun 2010 15:56:03 -0400 X-VirtualServerGroup: Default X-MailingID: 00000::00000::00000::00000::::1379 X-SMHeaderMap: mid="X-MailingID" X-Destination-ID: freebsd-fs@freebsd.org X-SMFBL: ZnJlZWJzZC1mc0BmcmVlYnNkLm9yZw== Message-ID: <4C05657A.7060900@comcast.net> Date: Tue, 01 Jun 2010 15:54:34 -0400 From: Steve Polyack User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.7) Gecko/20100311 Thunderbird/3.0.1 MIME-Version: 1.0 To: Darren Pilgrim References: <060401cafe37$a411b240$ec3516c0$@net> <4BFF894F.4010008@icyb.net.ua> <20100528134549.GA75411@icarus.home.lan> <4C05577F.7040001@bitfreak.org> In-Reply-To: <4C05577F.7040001@bitfreak.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: amd64@freebsd.org, freebsd-fs@freebsd.org Subject: Re: FreeBSD 8.1-Prerelease Panic amd64 w/ZFS.. X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2010 19:54:42 -0000 On 06/01/10 14:54, Darren Pilgrim wrote: > Jeremy Chadwick wrote: >> To the OP: you will need to increase vm.kmem_size in /boot/loader.conf >> and reboot the system. "What value do I pick?" With 4GB, I would >> recommend you use these two variables: >> >> vm.kmem_size="2048M" >> vfs.zfs.arc_max="1536M" >> >> This will increase the available kmem, and also limit the ARC size >> explicitly to nothing larger than 1.5GB. This should stabilise your >> system. > > What are the general guidelines for sizing these given the amount of > physical RAM? For example, I have a machine with 6 GB, so I have: > > vm.kmem_size="3072M" > vfs.zfs.arc_max="2048M" > Things may have changed, but I would recommend 'vm.kmem_size="9G"' (1.5x physical memory size) and an ARC max of 3GB (half memory size). If you are doing more than just serving ZFS on the box, you may want to keep the ARC max around 2GB or less to leave some for other applications. The vm.kmem_size recommendation is based on a a good bit of list reading I did several months ago when setting my ZFS system up. That machine has made it over 6 months of production usage without a crash while serving a few terabytes of data to various NFS clients. It has 8GB of physical RAM, a vm.kmem_size of 12G, and a vfs.zfs.arc_max of 4G. It's been running 8-STABLE since 03/24/2010. Side note: Jeremy's values may work great, but these are the values I've been using myself and have not had a single problem. ZFS rocks. Steve From owner-freebsd-fs@FreeBSD.ORG Wed Jun 2 07:55:49 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BE0B1065673 for ; Wed, 2 Jun 2010 07:55:49 +0000 (UTC) (envelope-from peterjeremy@acm.org) Received: from mail17.syd.optusnet.com.au (mail17.syd.optusnet.com.au [211.29.132.198]) by mx1.freebsd.org (Postfix) with ESMTP id DA42A8FC1D for ; Wed, 2 Jun 2010 07:55:47 +0000 (UTC) Received: from server.vk2pj.dyndns.org (c211-30-160-13.mirnd2.nsw.optusnet.com.au [211.30.160.13] (may be forged)) by mail17.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o527thQ7022652 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 2 Jun 2010 17:55:45 +1000 X-Bogosity: Ham, spamicity=0.000000 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.4/8.14.4) with ESMTP id o527tegT041814; Wed, 2 Jun 2010 17:55:40 +1000 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.4/8.14.4/Submit) id o527tdM9041813; Wed, 2 Jun 2010 17:55:39 +1000 (EST) (envelope-from peter) Date: Wed, 2 Jun 2010 17:55:39 +1000 From: Peter Jeremy To: Pierre Lamy Message-ID: <20100602075539.GA41763@server.vk2pj.dyndns.org> References: <4C0302A8.2000702@userid.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cWoXeonUoKmBZSoM" Content-Disposition: inline In-Reply-To: <4C0302A8.2000702@userid.org> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-fs Subject: Re: Trying to understand the boot process X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2010 07:55:49 -0000 --cWoXeonUoKmBZSoM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2010-May-30 20:28:24 -0400, Pierre Lamy wrote: >and extracted correctly to the appropriate local HD filesystem) but I=20 >can't figure out how to actually get it booted, it seems to be missing=20 >the MBR? > >I have already RTFM, and used bsdlabel -B ad4s1, and also tried fdisk=20 >-B. I simply get the "Reboot and select proper boot device or insert=20 >boot media..." message. > >Does anyone have any suggestions? Does 'boot0cfg -s 1 ad4' help? >My second question is how to label the boot options so that 1 says=20 >NanoBSD, 3 doesn't show up at all, and 5 days FreeBSD. Unfortunately, you can't. The 1..4 labels are based on the filesystem ID stored in the slice table and both NanoBSD and FreeBSD use 165. The MBR is limited to 512 bytes and there isn't space for many smarts. --=20 Peter Jeremy --cWoXeonUoKmBZSoM Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkwGDnsACgkQ/opHv/APuIe7iQCfYW0sc8bbGghGBdfOwns7L6J0 9LIAoIF2rMPyGg7KwwGYQMuQHSLaZVE/ =yW/f -----END PGP SIGNATURE----- --cWoXeonUoKmBZSoM-- From owner-freebsd-fs@FreeBSD.ORG Wed Jun 2 08:16:51 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BA34106567E for ; Wed, 2 Jun 2010 08:16:51 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 986EB8FC13 for ; Wed, 2 Jun 2010 08:16:50 +0000 (UTC) Received: by bwz2 with SMTP id 2so246134bwz.13 for ; Wed, 02 Jun 2010 01:16:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject :organization:references:date:in-reply-to:message-id:user-agent :mime-version:content-type; bh=XYk/qO1lFdm1BVz652kp0cF9fq1yxuQigArjTarRgJ4=; b=olag/WzqTOQKFSth3Vghyr3ZxS2OYz5TA1DE5EI+MkD/WRjZc7j3mz49bp5yObFWAH B2pg4H7KyO5MK4ukuPtLTrdRXn35U2MPtH3cv082Wzc25iUPnqzbk8SPXOwS0Ey+SVf/ HqBJflFTiUIjqh/tvgvElz8qxxiPShu8kW4ew= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; b=k6e52xpZVwhkw7jBQ4gYGmygc8OyzmG9FYal6LH5oZiLxVFQuOYomkhPLrHvjM4FTw elsJinW0IibfCYn5LdztUBlTvtl4FeeXIkO8+gtZUd9RQpJ9HdCTVTvIlhfDXP3lLvdi sidSmMZvGzX1hmcCGG3fyDhU2ZXQYPFsKeLWQ= Received: by 10.204.144.150 with SMTP id z22mr1513489bku.158.1275466609341; Wed, 02 Jun 2010 01:16:49 -0700 (PDT) Received: from localhost (ua1.etadirect.net [91.198.140.16]) by mx.google.com with ESMTPS id z17sm7102564bkx.0.2010.06.02.01.16.47 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 02 Jun 2010 01:16:47 -0700 (PDT) From: Mikolaj Golub To: Kostik Belousov Organization: TOA Ukraine References: <86fx16onx6.fsf@zhuzha.ua1> <20100601140721.GH83316@deviant.kiev.zoral.com.ua> Date: Wed, 02 Jun 2010 11:16:45 +0300 In-Reply-To: <20100601140721.GH83316@deviant.kiev.zoral.com.ua> (Kostik Belousov's message of "Tue, 1 Jun 2010 17:07:21 +0300") Message-ID: <86bpbtonma.fsf@zhuzha.ua1> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: freebsd-fs@freebsd.org Subject: Re: nullfs: vop_rename: fdvp is locked but should not be X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2010 08:16:51 -0000 --=-=-= KB> I am curious to look at the final patch. Note that you proposing to add KB> fs-specific check to vfs_subr.c. Checking that the the vnode locks are KB> different instead of that vnodes itself are different might be better KB> approach for vop_rename_pre. Ok. Looks a bit tricky :-). Then may be it is safe just to skip ASSERT() if the "target" and "from" vnodes are on different fs, like in the patch below? I have tried the patch on CURRENT. It looks like it works... -- Mikolaj Golub --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=vfs_subr.c.vop_rename_pre.patch Index: sys/kern/vfs_subr.c =================================================================== --- sys/kern/vfs_subr.c (revision 208724) +++ sys/kern/vfs_subr.c (working copy) @@ -3793,9 +3793,10 @@ vop_rename_pre(void *ap) ASSERT_VI_UNLOCKED(a->a_fdvp, "VOP_RENAME"); /* Check the source (from). */ - if (a->a_tdvp != a->a_fdvp && a->a_tvp != a->a_fdvp) + if (a->a_tdvp != a->a_fdvp && a->a_tdvp->v_mount == a->a_fdvp->v_mount + && a->a_tvp != a->a_fdvp) ASSERT_VOP_UNLOCKED(a->a_fdvp, "vop_rename: fdvp locked"); - if (a->a_tvp != a->a_fvp) + if (a->a_tvp != a->a_fvp && a->a_tvp && a->a_tvp->v_mount == a->a_fvp->v_mount) ASSERT_VOP_UNLOCKED(a->a_fvp, "vop_rename: fvp locked"); /* Check the target. */ --=-=-=-- From owner-freebsd-fs@FreeBSD.ORG Wed Jun 2 09:45:09 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F4BB1065672 for ; Wed, 2 Jun 2010 09:45:09 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id BDD6E8FC0C for ; Wed, 2 Jun 2010 09:45:08 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o529jIHA065303 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 2 Jun 2010 12:45:18 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o529j5B3053900; Wed, 2 Jun 2010 12:45:05 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o529j4ja053899; Wed, 2 Jun 2010 12:45:04 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 2 Jun 2010 12:45:04 +0300 From: Kostik Belousov To: Mikolaj Golub Message-ID: <20100602094504.GN83316@deviant.kiev.zoral.com.ua> References: <86fx16onx6.fsf@zhuzha.ua1> <20100601140721.GH83316@deviant.kiev.zoral.com.ua> <86bpbtonma.fsf@zhuzha.ua1> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="b385GY4hqirqljNZ" Content-Disposition: inline In-Reply-To: <86bpbtonma.fsf@zhuzha.ua1> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-fs@freebsd.org Subject: Re: nullfs: vop_rename: fdvp is locked but should not be X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2010 09:45:09 -0000 --b385GY4hqirqljNZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 02, 2010 at 11:16:45AM +0300, Mikolaj Golub wrote: >=20 > KB> I am curious to look at the final patch. Note that you proposing to = add > KB> fs-specific check to vfs_subr.c. Checking that the the vnode locks a= re > KB> different instead of that vnodes itself are different might be better > KB> approach for vop_rename_pre. >=20 > Ok. Looks a bit tricky :-). Then may be it is safe just to skip ASSERT() = if > the "target" and "from" vnodes are on different fs, like in the patch bel= ow? >=20 > I have tried the patch on CURRENT. It looks like it works... I do not think that the attached patch is the right solution Again, try. comparing the pointers to the vnode locks instead of the vnode pointers. Something like if (a->a_tdvp->v_vnlock !=3D a->a_fdvp->v_vnlock ... --b385GY4hqirqljNZ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkwGKCAACgkQC3+MBN1Mb4gIzgCgkt+FR7+AVpfA5R6eVv9lDLR+ KlcAoOcSTkG0ircVSI5sFDcc3h9BgFXJ =5xvT -----END PGP SIGNATURE----- --b385GY4hqirqljNZ-- From owner-freebsd-fs@FreeBSD.ORG Wed Jun 2 13:15:13 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD72A1065676 for ; Wed, 2 Jun 2010 13:15:13 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.152]) by mx1.freebsd.org (Postfix) with ESMTP id 475238FC14 for ; Wed, 2 Jun 2010 13:15:12 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id d23so1723494fga.13 for ; Wed, 02 Jun 2010 06:15:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject :organization:references:date:in-reply-to:message-id:user-agent :mime-version:content-type; bh=MrJDWLGps8uaulG9EGeHRCiQJEmlBHjvTHq6tSrwtnc=; b=pMHM0lSpQbJjaOYULIg84eia6jOnAhU8JHo77gUjIkaaVuWjC3ViwYp6G7cjKe3nqE iLZSu9x3SFyEvH9FfMG63i8Z0W2VOhtXBtG4ve/UKDEK60cczvlcq/Aq8eQbiTU6oC3n t4+K3+sfXBGXGkCpqAVGLje66ZVPESLwkpj/A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; b=IhobW9jyDxvfFo6XbyKwKqP97SNdq/mSytqcLetIeD59qch8iWLAoCoq5afrfPKjYO SKvN9Y5wUw2rqdLsITMCIhQD73IpEj9wShX3p9v+qq+IcnWVBUDnmKfiOOCZNyX+5B2t ZEF/47oR4I+0U/RKn3CyGm43CPyEfRVqSOTUM= Received: by 10.204.47.17 with SMTP id l17mr1791509bkf.82.1275484511985; Wed, 02 Jun 2010 06:15:11 -0700 (PDT) Received: from localhost (ua1.etadirect.net [91.198.140.16]) by mx.google.com with ESMTPS id v2sm8136740bkz.19.2010.06.02.06.15.10 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 02 Jun 2010 06:15:10 -0700 (PDT) From: Mikolaj Golub To: Kostik Belousov Organization: TOA Ukraine References: <86fx16onx6.fsf@zhuzha.ua1> <20100601140721.GH83316@deviant.kiev.zoral.com.ua> <86bpbtonma.fsf@zhuzha.ua1> <20100602094504.GN83316@deviant.kiev.zoral.com.ua> Date: Wed, 02 Jun 2010 16:15:08 +0300 In-Reply-To: <20100602094504.GN83316@deviant.kiev.zoral.com.ua> (Kostik Belousov's message of "Wed, 2 Jun 2010 12:45:04 +0300") Message-ID: <867hmho9sz.fsf@zhuzha.ua1> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: freebsd-fs@freebsd.org Subject: Re: nullfs: vop_rename: fdvp is locked but should not be X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2010 13:15:13 -0000 --=-=-= On Wed, 2 Jun 2010 12:45:04 +0300 Kostik Belousov wrote: KB> I do not think that the attached patch is the right solution Again, try. KB> comparing the pointers to the vnode locks instead of the vnode pointers. KB> Something like KB> if (a->a_tdvp->v_vnlock != a->a_fdvp->v_vnlock ... Please look at the attached patch. I have tried it on CURRENT. -- Mikolaj Golub --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=vfs_subr.c.vop_rename_pre.patch Index: sys/kern/vfs_subr.c =================================================================== --- sys/kern/vfs_subr.c (revision 208731) +++ sys/kern/vfs_subr.c (working copy) @@ -3793,9 +3793,10 @@ vop_rename_pre(void *ap) ASSERT_VI_UNLOCKED(a->a_fdvp, "VOP_RENAME"); /* Check the source (from). */ - if (a->a_tdvp != a->a_fdvp && a->a_tvp != a->a_fdvp) + if (a->a_tdvp->v_vnlock != a->a_fdvp->v_vnlock && + (a->a_tvp == NULL || a->a_tvp->v_vnlock != a->a_fdvp->v_vnlock)) ASSERT_VOP_UNLOCKED(a->a_fdvp, "vop_rename: fdvp locked"); - if (a->a_tvp != a->a_fvp) + if (a->a_tvp == NULL || a->a_tvp->v_vnlock != a->a_fvp->v_vnlock) ASSERT_VOP_UNLOCKED(a->a_fvp, "vop_rename: fvp locked"); /* Check the target. */ --=-=-=-- From owner-freebsd-fs@FreeBSD.ORG Wed Jun 2 14:59:01 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 102111065674 for ; Wed, 2 Jun 2010 14:59:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 7EDFA8FC17 for ; Wed, 2 Jun 2010 14:59:00 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o52Ex9OM093268 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 2 Jun 2010 17:59:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o52Ewux8056025; Wed, 2 Jun 2010 17:58:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o52EwurR056024; Wed, 2 Jun 2010 17:58:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 2 Jun 2010 17:58:56 +0300 From: Kostik Belousov To: Andriy Gapon Message-ID: <20100602145856.GR83316@deviant.kiev.zoral.com.ua> References: <4C03E9C0.2010602@icyb.net.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/Snnur4OkUpibtcK" Content-Disposition: inline In-Reply-To: <4C03E9C0.2010602@icyb.net.ua> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-fs@freebsd.org Subject: Re: nullfs distinct path check: take into account filesystems X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2010 14:59:01 -0000 --/Snnur4OkUpibtcK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 31, 2010 at 07:54:24PM +0300, Andriy Gapon wrote: >=20 > Right now mount_nullfs doesn't allow to, for example, mount / in > /tmp/somedir even if /tmp is a different filesystem. I think there is > no reason to do that and thus propose the following patch. Reason is that after such mount "find /" would never end. --/Snnur4OkUpibtcK Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkwGca8ACgkQC3+MBN1Mb4iRWACgoUEBVdwJt+P2txE96yNXMsra K6YAoMGQ4WPtM2NUNnp2ZfjuoihPbfaK =Yx4i -----END PGP SIGNATURE----- --/Snnur4OkUpibtcK-- From owner-freebsd-fs@FreeBSD.ORG Wed Jun 2 15:14:02 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4E0E1065673 for ; Wed, 2 Jun 2010 15:14:02 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 4EDDC8FC1A for ; Wed, 2 Jun 2010 15:14:01 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o52FEClU094870 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 2 Jun 2010 18:14:12 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o52FDwiq056125; Wed, 2 Jun 2010 18:13:58 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o52FDwat056124; Wed, 2 Jun 2010 18:13:58 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 2 Jun 2010 18:13:58 +0300 From: Kostik Belousov To: Andriy Gapon Message-ID: <20100602151358.GS83316@deviant.kiev.zoral.com.ua> References: <4C03E9C0.2010602@icyb.net.ua> <20100602145856.GR83316@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XdR1wT9k+oDfhgRH" Content-Disposition: inline In-Reply-To: <20100602145856.GR83316@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-fs@freebsd.org Subject: Re: nullfs distinct path check: take into account filesystems X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2010 15:14:02 -0000 --XdR1wT9k+oDfhgRH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 02, 2010 at 05:58:56PM +0300, Kostik Belousov wrote: > On Mon, May 31, 2010 at 07:54:24PM +0300, Andriy Gapon wrote: > >=20 > > Right now mount_nullfs doesn't allow to, for example, mount / in > > /tmp/somedir even if /tmp is a different filesystem. I think there is > > no reason to do that and thus propose the following patch. >=20 > Reason is that after such mount "find /" would never end. Hm, "different filesystems". Sorry, ignore my answer. --XdR1wT9k+oDfhgRH Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkwGdTYACgkQC3+MBN1Mb4gjEQCcCTHYQrFiioPpxNJIGmmlKgSG WowAoMshLMIK2C+7M/QbT8EscerjHXak =A4Ao -----END PGP SIGNATURE----- --XdR1wT9k+oDfhgRH-- From owner-freebsd-fs@FreeBSD.ORG Thu Jun 3 14:35:07 2010 Return-Path: Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 747B31065678; Thu, 3 Jun 2010 14:35:07 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw03.mail.saunalahti.fi (gw03.mail.saunalahti.fi [195.197.172.111]) by mx1.freebsd.org (Postfix) with ESMTP id E37F38FC14; Thu, 3 Jun 2010 14:35:06 +0000 (UTC) Received: from a91-153-117-195.elisa-laajakaista.fi (a91-153-117-195.elisa-laajakaista.fi [91.153.117.195]) by gw03.mail.saunalahti.fi (Postfix) with SMTP id 1DDE62164E9; Thu, 3 Jun 2010 17:35:02 +0300 (EEST) Date: Thu, 3 Jun 2010 17:35:01 +0300 From: Jaakko Heinonen To: freebsd-fs@FreeBSD.org Message-ID: <20100603143501.GA3176@a91-153-117-195.elisa-laajakaista.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Cc: attilio@FreeBSD.org, kib@FreeBSD.org Subject: syncer vnode leak because of nmount() race X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2010 14:35:07 -0000 Hi, I have been playing with devfs and stress2 recently and I was able to trigger a syncer vnode leak with devfs.sh. As far as I can tell it is a nmount(2) (initial) mount race against update mount. The code in vfs_domount() is protected with vfs_busy()/vfs_unbusy() but it doesn't protect against update mounts. The protection by Giant is defeated because devfs_root() may sleep due to sx_xlock(). vfs_domount() calls VFS_ROOT() before allocating the syncer vnode. VI_MOUNT vnode flag doesn't provide sufficient protection against update mounts either. I created following patch to work around the problem. I am unsure if the approach is good however. %%% Index: sys/kern/vfs_mount.c =================================================================== --- sys/kern/vfs_mount.c (revision 208667) +++ sys/kern/vfs_mount.c (working copy) @@ -906,6 +906,16 @@ vfs_domount( vput(vp); return (EBUSY); } + if (mp->mnt_vnodecovered != NULL) { + VI_LOCK(mp->mnt_vnodecovered); + if ((mp->mnt_vnodecovered->v_iflag & VI_MOUNT) != 0) { + VI_UNLOCK(mp->mnt_vnodecovered); + vfs_unbusy(mp); + vput(vp); + return (EBUSY); + } + VI_UNLOCK(mp->mnt_vnodecovered); + } VI_LOCK(vp); if ((vp->v_iflag & VI_MOUNT) != 0 || vp->v_mountedhere != NULL) { @@ -1060,17 +1070,10 @@ vfs_domount( * Put the new filesystem on the mount list after root. */ cache_purge(vp); - VI_LOCK(vp); - vp->v_iflag &= ~VI_MOUNT; - VI_UNLOCK(vp); if (!error) { struct vnode *newdp; vp->v_mountedhere = mp; - mtx_lock(&mountlist_mtx); - TAILQ_INSERT_TAIL(&mountlist, mp, mnt_list); - mtx_unlock(&mountlist_mtx); - vfs_event_signal(NULL, VQ_MOUNT, 0); if (VFS_ROOT(mp, LK_EXCLUSIVE, &newdp)) panic("mount: lost mount"); VOP_UNLOCK(newdp, 0); @@ -1079,10 +1082,20 @@ vfs_domount( vrele(newdp); if ((mp->mnt_flag & MNT_RDONLY) == 0) error = vfs_allocate_syncvnode(mp); + VI_LOCK(vp); + vp->v_iflag &= ~VI_MOUNT; + VI_UNLOCK(vp); + mtx_lock(&mountlist_mtx); + TAILQ_INSERT_TAIL(&mountlist, mp, mnt_list); + mtx_unlock(&mountlist_mtx); + vfs_event_signal(NULL, VQ_MOUNT, 0); vfs_unbusy(mp); if (error) vrele(vp); } else { + VI_LOCK(vp); + vp->v_iflag &= ~VI_MOUNT; + VI_UNLOCK(vp); vfs_unbusy(mp); vfs_mount_destroy(mp); vput(vp); %%% Comments? PS. vfs_unbusy(9) manual page is out of date after r184554 and IMO vfs_busy(9) manual page is misleading because it talks about synchronizing access to a mount point. -- Jaakko From owner-freebsd-fs@FreeBSD.ORG Thu Jun 3 14:55:20 2010 Return-Path: Delivered-To: freebsd-fs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 933DB1065678; Thu, 3 Jun 2010 14:55:20 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (unknown [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 6AEDA8FC12; Thu, 3 Jun 2010 14:55:20 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o53EtKhN034576; Thu, 3 Jun 2010 14:55:20 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o53EtKok034572; Thu, 3 Jun 2010 14:55:20 GMT (envelope-from linimon) Date: Thu, 3 Jun 2010 14:55:20 GMT Message-Id: <201006031455.o53EtKok034572@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-fs@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: kern/147420: [nfs] [panic] kldload nfs modules causes nfs-aware kernel panic after a while X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2010 14:55:20 -0000 Old Synopsis: [nfs] kldload nfs modules causes nfs-aware kernel panic after a while New Synopsis: [nfs] [panic] kldload nfs modules causes nfs-aware kernel panic after a while Responsible-Changed-From-To: freebsd-bugs->freebsd-fs Responsible-Changed-By: linimon Responsible-Changed-When: Thu Jun 3 14:54:52 UTC 2010 Responsible-Changed-Why: Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=147420 From owner-freebsd-fs@FreeBSD.ORG Thu Jun 3 22:03:56 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBB3F106564A; Thu, 3 Jun 2010 22:03:56 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id EC2808FC0A; Thu, 3 Jun 2010 22:03:55 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id BAA20852; Fri, 04 Jun 2010 01:03:52 +0300 (EEST) (envelope-from avg@icyb.net.ua) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1OKIW0-000137-7F; Fri, 04 Jun 2010 01:03:52 +0300 Message-ID: <4C0826C7.7070900@icyb.net.ua> Date: Fri, 04 Jun 2010 01:03:51 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100321) MIME-Version: 1.0 To: Doug Rabson References: <4BEBA334.6080101@icyb.net.ua> <4BEC040E.9080303@FreeBSD.org> <4BFE2ED6.1070402@freebsd.org> <4BFE8C07.9010303@icyb.net.ua> In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-fs@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: bin/144214: zfsboot fails on gang block after upgrade to zfs v14 X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2010 22:03:56 -0000 on 28/05/2010 17:49 Doug Rabson said the following: > > > On 27 May 2010 16:13, Andriy Gapon > wrote: > > on 27/05/2010 17:40 Doug Rabson said the following: > > > > Excellent work - thanks for looking into this. I still think its > easier > > to debug this code in userland using a shim that redirects the zfsboot > > i/o calls to simple read system calls... > > Absolutely! That should much easier. > Do you have such a shim that you could share? > I'd be much obliged for it. And not only I, I think. > Thanks! > > > Attached. I thought I sent it to the list before but perhaps I only sent > to one of the participants in the last gang block thread. Thanks a lot! I am sure that I will find it useful more than once. -- Andriy Gapon From owner-freebsd-fs@FreeBSD.ORG Fri Jun 4 02:30:33 2010 Return-Path: Delivered-To: freebsd-fs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F23E106566C; Fri, 4 Jun 2010 02:30:33 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (unknown [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id DB0E18FC0C; Fri, 4 Jun 2010 02:30:32 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o542UW8w031457; Fri, 4 Jun 2010 02:30:32 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o542UWut031449; Fri, 4 Jun 2010 02:30:32 GMT (envelope-from linimon) Date: Fri, 4 Jun 2010 02:30:32 GMT Message-Id: <201006040230.o542UWut031449@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-fs@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: kern/147292: [nfs] [patch] readahead missing in nfs client options filter list X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2010 02:30:33 -0000 Old Synopsis: readahead missing in nfs client options filter list New Synopsis: [nfs] [patch] readahead missing in nfs client options filter list Responsible-Changed-From-To: freebsd-bugs->freebsd-fs Responsible-Changed-By: linimon Responsible-Changed-When: Fri Jun 4 02:30:11 UTC 2010 Responsible-Changed-Why: Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=147292 From owner-freebsd-fs@FreeBSD.ORG Fri Jun 4 07:50:04 2010 Return-Path: Delivered-To: freebsd-fs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 428A6106567A for ; Fri, 4 Jun 2010 07:50:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (unknown [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 31D258FC0C for ; Fri, 4 Jun 2010 07:50:04 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o547o3EG031732 for ; Fri, 4 Jun 2010 07:50:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o547o3Wo031731; Fri, 4 Jun 2010 07:50:03 GMT (envelope-from gnats) Date: Fri, 4 Jun 2010 07:50:03 GMT Message-Id: <201006040750.o547o3Wo031731@freefall.freebsd.org> To: freebsd-fs@FreeBSD.org From: "Peter Cornelius" Cc: Subject: Re: kern/147420: [nfs] kldload nfs modules causes nfs-aware kernel panic after a while X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Peter Cornelius List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2010 07:50:04 -0000 The following reply was made to PR kern/147420; it has been noted by GNATS. From: "Peter Cornelius" To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-bugs@FreeBSD.org Cc: Subject: Re: kern/147420: [nfs] kldload nfs modules causes nfs-aware kernel panic after a while Date: Fri, 04 Jun 2010 09:45:00 +0200 Re. The situation has re-occurred at the exact same spot. panic: ufs_dirbad: /usr: bad dir ino 46895494 at offset 114368: mangled entry cpuid=1 KDB: enter: panic [thread pid 42063 tid 100153] Stopped at kdb_enter+0x3a movl $0,kdb_why I now googled with [nfs|ufs]_dirbad as a better keyword and hence now think that this issue actually may be a duplicate of kern/135690. I have a screenshot photo of a bt and can supply that on request; no textual dumps due to no dumps, sorry. I can leave the box on for another one or two hours if anyone wishes other commands meanwhile. What remains is the question how to find and get rid of the entry now, and whether I should go back to INVARIANTS* on in the kernel in order to avoid further mangling. The box previously has survived months up building (and running) RELENG_8 kernels & worlds happily during the last year with INVARIANTS on. Thanks, Peter. -- GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT! Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01 From owner-freebsd-fs@FreeBSD.ORG Fri Jun 4 15:00:52 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16995106564A; Fri, 4 Jun 2010 15:00:52 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 867698FC1C; Fri, 4 Jun 2010 15:00:51 +0000 (UTC) Received: by gyh20 with SMTP id 20so1258408gyh.13 for ; Fri, 04 Jun 2010 08:00:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=gZq1HKsxkDjzGhenpqpe1WhRW25OocUGqAm2ork1MRk=; b=tYpnuOavmaSyx9b1vnT80o2cwl7LJXTfyVUyjSIes785gDp3/2hDzbXd1W14jxyxLe 4WVjxouxe3o/JexZYwY2cLtlM7TA5O0kHeIwQHY0qkOx+IFE6QTbVe6E+uWdvg1biQOt rHyHxJs3mF3ZTsim0Eljnqf0Zfrt8huKS63Us= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=t6tT+XmmSXVO+Bqm0ACppaxOo/fx73Gt/bmFdNCQsfr4v9dy6bQJPzl4IMNbvKZjRO UZW9ue5jSYrXINmk5opZ4yOf+2H7jG0CYzYvcuG5Qx/yqY2gp5f8VIlp7q8G6pM7Geox nGGDbgDVcRXzCz8/ZjBZco3826hRA+xsjeYe8= MIME-Version: 1.0 Received: by 10.224.93.203 with SMTP id w11mr5432387qam.335.1275663649779; Fri, 04 Jun 2010 08:00:49 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.229.183.213 with HTTP; Fri, 4 Jun 2010 08:00:49 -0700 (PDT) In-Reply-To: <20100603143501.GA3176@a91-153-117-195.elisa-laajakaista.fi> References: <20100603143501.GA3176@a91-153-117-195.elisa-laajakaista.fi> Date: Fri, 4 Jun 2010 17:00:49 +0200 X-Google-Sender-Auth: Tn7NqIGgHlDVr3ZkrEDv8IufQrg Message-ID: From: Attilio Rao To: Jaakko Heinonen Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-fs@freebsd.org, kib@freebsd.org Subject: Re: syncer vnode leak because of nmount() race X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2010 15:00:52 -0000 2010/6/3 Jaakko Heinonen : > > Hi, > > I have been playing with devfs and stress2 recently and I was able to > trigger a syncer vnode leak with devfs.sh. As far as I can tell it is a > nmount(2) (initial) mount race against update mount. The code in > vfs_domount() is protected with vfs_busy()/vfs_unbusy() but it doesn't > protect against update mounts. The protection by Giant is defeated > because devfs_root() may sleep due to sx_xlock(). vfs_domount() calls > VFS_ROOT() before allocating the syncer vnode. VI_MOUNT vnode flag > doesn't provide sufficient protection against update mounts either. Thanks for this bug report. I think that, luckilly, it is not a very common condition to have the mount still in flight and get updates... :) However, I think that the real breakage here is that the check on mnt->mnt_syncer is done lockless and it is unsafe. It might really be protected by the mount interlock but that's tricky because vfs_allocate_syncvnode() sleeps. Also re-checking the condition (after the allocation takes place) is not too simple here. I found also this bug when rewriting the syncer and I resolved that by using a separate flag for that (in my case it was simpler and more beneficial actually for some other reasons, but you may do the same thing with a mnt_kern_flag entry). If you have no time I can work actively on the patch, even if I'm confident, luckilly, this problem is very hard to happen in the real life. Additively, note that vfs_busy() here is not intended to protect against such situations but against unmount. Also, I'm very unsure about what Giant protection might bring here. IMHO we might probabilly remove it at all as long as all the sleeping point present make it completely unuseful if anything (and I don't see a reason why it may be needed). > PS. vfs_unbusy(9) manual page is out of date after r184554 and IMO > =C2=A0 =C2=A0vfs_busy(9) manual page is misleading because it talks about > =C2=A0 =C2=A0synchronizing access to a mount point. May you be more precise on what is misleading please? Thanks, Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-freebsd-fs@FreeBSD.ORG Sat Jun 5 19:07:04 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8080A1065670; Sat, 5 Jun 2010 19:07:04 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw03.mail.saunalahti.fi (gw03.mail.saunalahti.fi [195.197.172.111]) by mx1.freebsd.org (Postfix) with ESMTP id 371588FC13; Sat, 5 Jun 2010 19:07:04 +0000 (UTC) Received: from a91-153-117-195.elisa-laajakaista.fi (a91-153-117-195.elisa-laajakaista.fi [91.153.117.195]) by gw03.mail.saunalahti.fi (Postfix) with ESMTP id 93A8821659D; Sat, 5 Jun 2010 22:06:59 +0300 (EEST) Date: Sat, 5 Jun 2010 22:06:59 +0300 From: Jaakko Heinonen To: Attilio Rao Message-ID: <20100605190659.GA3369@a91-153-117-195.elisa-laajakaista.fi> References: <20100603143501.GA3176@a91-153-117-195.elisa-laajakaista.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-fs@freebsd.org, kib@freebsd.org Subject: Re: syncer vnode leak because of nmount() race X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jun 2010 19:07:04 -0000 Thank you for the reply. On 2010-06-04, Attilio Rao wrote: > I think that, luckilly, it is not a very common condition to have the > mount still in flight and get updates... :) Agreed, but mountd(8) increases chances because it does an update mount for all local file systems when it receives SIGHUP. > However, I think that the real breakage here is that the check on > mnt->mnt_syncer is done lockless and it is unsafe. > I found also this bug when rewriting the syncer and I resolved that by > using a separate flag for that (in my case it was simpler and more > beneficial actually for some other reasons, but you may do the same > thing with a mnt_kern_flag entry). OK, I will take a look at this approach. > Additively, note that vfs_busy() here is not intended to protect > against such situations but against unmount. > > > PS. vfs_unbusy(9) manual page is out of date after r184554 and IMO > >    vfs_busy(9) manual page is misleading because it talks about > >    synchronizing access to a mount point. > > May you be more precise on what is misleading please? As you wrote above it protects only against unmount. At least I got feeling that it does more than that when I read this: "The purpose of this function is to synchronize access to a mount point. It also delays unmounting by sleeping on mp if the MNTK_UNMOUNT flag is set in mp->mnt_kern_flag and the LK_NOWAIT flag is not set.". I did some updates for the manual pages: http://people.freebsd.org/~jh/patches/vfs_busy-vfs_unbusy.diff -- Jaakko