Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Sep 2012 23:10:11 +0000 (UTC)
From:      Attilio Rao <attilio@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r240221 - projects/fuse/sys/fs/fuse
Message-ID:  <201209072310.q87NAB2k079815@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209072310.q87NAB2k079815>