From owner-p4-projects@FreeBSD.ORG Mon Aug 1 21:39:46 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4F878106566C; Mon, 1 Aug 2011 21:39:46 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12410106564A for ; Mon, 1 Aug 2011 21:39:46 +0000 (UTC) (envelope-from ilya@FreeBSD.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id F3BE48FC08 for ; Mon, 1 Aug 2011 21:39:45 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id p71LdjSj066594 for ; Mon, 1 Aug 2011 21:39:45 GMT (envelope-from ilya@FreeBSD.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p71Ldjcb066591 for perforce@freebsd.org; Mon, 1 Aug 2011 21:39:45 GMT (envelope-from ilya@FreeBSD.org) Date: Mon, 1 Aug 2011 21:39:45 GMT Message-Id: <201108012139.p71Ldjcb066591@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to ilya@FreeBSD.org using -f From: Ilya Putsikau To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 197037 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2011 21:39:46 -0000 http://p4web.freebsd.org/@@197037?ac=10 Change 197037 by ilya@ilya_triton2011 on 2011/08/01 21:38:48 Fix file close-release race Make fuse_filehandle_close foreground only Change version to 0.4.3 Affected files ... .. //depot/projects/soc2011/ilya_fuse/fuse/fuse.h#2 edit .. //depot/projects/soc2011/ilya_fuse/fuse/fuse_file.c#3 edit .. //depot/projects/soc2011/ilya_fuse/fuse/fuse_file.h#2 edit .. //depot/projects/soc2011/ilya_fuse/fuse/fuse_version.h#2 edit .. //depot/projects/soc2011/ilya_fuse/fuse/fuse_vnops.c#3 edit Differences ... ==== //depot/projects/soc2011/ilya_fuse/fuse/fuse.h#2 (text+ko) ==== @@ -162,10 +162,5 @@ __STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ } while (0) -typedef enum fuse_op_waitfor { - FUSE_OP_BACKGROUNDED = 0, - FUSE_OP_FOREGROUNDED = 1, -} fuse_op_waitfor_t; - void fuse_ipc_init(void); void fuse_ipc_destroy(void); ==== //depot/projects/soc2011/ilya_fuse/fuse/fuse_file.c#3 (text+ko) ==== @@ -101,8 +101,7 @@ fuse_filehandle_close(struct vnode *vp, fufh_type_t fufh_type, struct thread *td, - struct ucred *cred, - fuse_op_waitfor_t waitfor) + struct ucred *cred) { struct fuse_dispatcher fdi; struct fuse_release_in *fri; @@ -138,12 +137,7 @@ fri->fh = fufh->fh_id; fri->flags = fuse_filehandle_xlate_to_oflags(fufh_type); - if (waitfor == FUSE_OP_FOREGROUNDED) { - err = fdisp_wait_answ(&fdi); - } else { - fuse_insert_callback(fdi.tick, NULL); - fuse_insert_message(fdi.tick); - } + err = fdisp_wait_answ(&fdi); fdisp_destroy(&fdi); out: ==== //depot/projects/soc2011/ilya_fuse/fuse/fuse_file.h#2 (text+ko) ==== @@ -96,7 +96,6 @@ struct fuse_filehandle **fufhp, struct thread *td, struct ucred *cred); int fuse_filehandle_close(struct vnode *vp, fufh_type_t fufh_type, - struct thread *td, struct ucred *cred, - fuse_op_waitfor_t waitfor); + struct thread *td, struct ucred *cred); #endif /* _FUSE_FILE_H_ */ ==== //depot/projects/soc2011/ilya_fuse/fuse/fuse_version.h#2 (text+ko) ==== @@ -1,3 +1,3 @@ #ifndef FUSE_FREEBSD_VERSION -#define FUSE_FREEBSD_VERSION "0.4.2" +#define FUSE_FREEBSD_VERSION "0.4.3" #endif ==== //depot/projects/soc2011/ilya_fuse/fuse/fuse_vnops.c#3 (text+ko) ==== @@ -566,7 +566,7 @@ fuse_io_flushbuf(vp, MNT_WAIT, td); need_flush = 0; } - fuse_filehandle_close(vp, type, td, NULL, FUSE_OP_BACKGROUNDED); + fuse_filehandle_close(vp, type, td, NULL); } } @@ -1260,8 +1260,7 @@ fiov_teardown(&cookediov); if (freefufh) { - fuse_filehandle_close(vp, FUFH_RDONLY, NULL, cred, - FUSE_OP_FOREGROUNDED); + fuse_filehandle_close(vp, FUFH_RDONLY, NULL, cred); } return err; @@ -1343,7 +1342,7 @@ if (FUFH_IS_VALID(fufh)) { printf("FUSE: vnode being reclaimed but fufh (type=%d) is valid", type); - fuse_filehandle_close(vp, type, td, NULL, FUSE_OP_BACKGROUNDED); + fuse_filehandle_close(vp, type, td, NULL); } }