From owner-svn-src-projects@FreeBSD.ORG Fri Sep 7 23:10:11 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86BEF10656ED; Fri, 7 Sep 2012 23:10:11 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58C318FC08; Fri, 7 Sep 2012 23:10:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q87NABhD079817; Fri, 7 Sep 2012 23:10:11 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q87NAB2k079815; Fri, 7 Sep 2012 23:10:11 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201209072310.q87NAB2k079815@svn.freebsd.org> From: Attilio Rao Date: Fri, 7 Sep 2012 23:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240221 - projects/fuse/sys/fs/fuse X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2012 23:10:11 -0000 Author: attilio Date: Fri Sep 7 23:10:10 2012 New Revision: 240221 URL: http://svn.freebsd.org/changeset/base/240221 Log: There is no need for some vnop operations to panic if the filesystem got closed in a way or another. Also, this could really happen in practice because operations may be still in flight. Fix it by just returning ENXIO as all the other vnops do. Reported by: Gustau Perez i Querol Tested by: Gustau Perez i Querol Modified: projects/fuse/sys/fs/fuse/fuse_vnops.c Modified: projects/fuse/sys/fs/fuse/fuse_vnops.c ============================================================================== --- projects/fuse/sys/fs/fuse/fuse_vnops.c Fri Sep 7 23:05:41 2012 (r240220) +++ projects/fuse/sys/fs/fuse/fuse_vnops.c Fri Sep 7 23:10:10 2012 (r240221) @@ -325,7 +325,7 @@ fuse_vnop_create(struct vop_create_args fuse_trace_printf_vnop(); if (fuse_isdeadfs(dvp)) { - panic("FUSE: fuse_vnop_create(): called on a dead file system"); + return ENXIO; } bzero(&fdi, sizeof(fdi)); @@ -614,7 +614,7 @@ fuse_vnop_link(struct vop_link_args *ap) fuse_trace_printf_vnop(); if (fuse_isdeadfs(vp)) { - panic("FUSE: fuse_vnop_link(): called on a dead file system"); + return ENXIO; } if (vnode_mount(tdvp) != vnode_mount(vp)) { return EXDEV; @@ -1090,7 +1090,7 @@ fuse_vnop_mkdir(struct vop_mkdir_args *a fuse_trace_printf_vnop(); if (fuse_isdeadfs(dvp)) { - panic("FUSE: fuse_vnop_mkdir(): called on a dead file system"); + return ENXIO; } fmdi.mode = MAKEIMODE(vap->va_type, vap->va_mode); @@ -1356,7 +1356,7 @@ fuse_vnop_remove(struct vop_remove_args (uintmax_t)VTOI(vp), (int)cnp->cn_namelen, cnp->cn_nameptr); if (fuse_isdeadfs(vp)) { - panic("FUSE: fuse_vnop_remove(): called on a dead file system"); + return ENXIO; } if (vnode_isdir(vp)) { return EPERM; @@ -1401,7 +1401,7 @@ fuse_vnop_rename(struct vop_rename_args (int)tcnp->cn_namelen, tcnp->cn_nameptr); if (fuse_isdeadfs(fdvp)) { - panic("FUSE: fuse_vnop_rename(): called on a dead file system"); + return ENXIO; } if (fvp->v_mount != tdvp->v_mount || (tvp && fvp->v_mount != tvp->v_mount)) { @@ -1473,7 +1473,7 @@ fuse_vnop_rmdir(struct vop_rmdir_args *a DEBUG2G("inode=%ju\n", (uintmax_t)VTOI(vp)); if (fuse_isdeadfs(vp)) { - panic("FUSE: fuse_vnop_rmdir(): called on a dead file system"); + return ENXIO; } if (VTOFUD(vp) == VTOFUD(dvp)) { return EINVAL; @@ -1693,7 +1693,7 @@ fuse_vnop_symlink(struct vop_symlink_arg (uintmax_t)VTOI(dvp), (int)cnp->cn_namelen, cnp->cn_nameptr); if (fuse_isdeadfs(dvp)) { - panic("FUSE: fuse_vnop_symlink(): called on a dead file system"); + return ENXIO; } /* * Unlike the other creator type calls, here we have to create a message