From owner-freebsd-fs@FreeBSD.ORG Mon Aug 21 13:22:16 2006 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4B7B316A4DE; Mon, 21 Aug 2006 13:22:16 +0000 (UTC) (envelope-from Tor.Egge@cvsup.no.freebsd.org) Received: from pil.idi.ntnu.no (pil.idi.ntnu.no [129.241.107.93]) by mx1.FreeBSD.org (Postfix) with ESMTP id E830743D76; Mon, 21 Aug 2006 13:22:05 +0000 (GMT) (envelope-from Tor.Egge@cvsup.no.freebsd.org) Received: from cvsup.no.freebsd.org (c2h5oh.idi.ntnu.no [129.241.103.69]) by pil.idi.ntnu.no (8.13.6/8.13.1) with ESMTP id k7LDM3TR012044 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 21 Aug 2006 15:22:03 +0200 (MEST) Received: from localhost (localhost [127.0.0.1]) by cvsup.no.freebsd.org (8.13.4/8.13.4) with ESMTP id k7LDM242042354; Mon, 21 Aug 2006 13:22:02 GMT (envelope-from Tor.Egge@cvsup.no.freebsd.org) Date: Mon, 21 Aug 2006 13:21:51 +0000 (UTC) Message-Id: <20060821.132151.41668008.Tor.Egge@cvsup.no.freebsd.org> To: kostikbel@gmail.com From: Tor Egge In-Reply-To: <20060818.202001.74745664.Tor.Egge@cvsup.no.freebsd.org> References: <20060817170314.GA17490@peter.osted.lan> <20060818164903.GF20768@deviant.kiev.zoral.com.ua> <20060818.202001.74745664.Tor.Egge@cvsup.no.freebsd.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned-By: mimedefang.idi.ntnu.no, using CLAMD X-SMTP-From: Sender=, Relay/Client=c2h5oh.idi.ntnu.no [129.241.103.69], EHLO=cvsup.no.freebsd.org X-Scanned-By: MIMEDefang 2.48 on 129.241.107.38 X-Scanned-By: mimedefang.idi.ntnu.no, using MIMEDefang 2.48 with local filter 16.42-idi X-Filter-Time: 1 seconds Cc: freebsd-fs@freebsd.org, tegge@freebsd.org Subject: Re: Deadlock between nfsd and snapshots. 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, 21 Aug 2006 13:22:16 -0000 I wrote: > The deadlock indicates that one or more of IN_CHANGE, IN_MODIFIED or > IN_UPDATE was set on the inode, indicating a write operation > (e.g. VOP_WRITE(), VOP_RENAME(), VOP_CREATE(), VOP_REMOVE(), VOP_LINK(), > VOP_SYMLINK(), VOP_SETATTR(), VOP_MKDIR(), VOP_RMDIR(), VOP_MKNOD()) that was > not protected by vn_start_write() or vn_start_secondary_write(). The most common "write" operation was probably VOP_GETATTR(). ufs_itimes(), called from ufs_getattr(), might set the IN_MODIFIED inode flag if IN_ACCESS is set on the inode even if neither IN_CHANGE nor IN_UPDATE is set, transitioning the inode flags into a state where ufs_inactive() calls the blocking variant of vn_start_secondary_write(). calling ufs_itimes() with only a shared vnode lock might cause unsafe accesses to the inode flags. Setting of IN_ACCESS at the end of ffs_read() and ffs_extread() might also be unsafe. If DIRECTIO is enabled then O_DIRECT reads might not even attempt to set the IN_ACCESS flag. - Tor Egge