Deleted Added
full compact
vfs_default.c (276192) vfs_default.c (276200)
1/*-
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed
6 * to Berkeley by John Heidemann of the UCLA Ficus project.
7 *
8 * Source: * @(#)i405_init.c 2.10 92/04/27 UCLA Ficus project

--- 19 unchanged lines hidden (view full) ---

28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 */
34
35#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed
6 * to Berkeley by John Heidemann of the UCLA Ficus project.
7 *
8 * Source: * @(#)i405_init.c 2.10 92/04/27 UCLA Ficus project

--- 19 unchanged lines hidden (view full) ---

28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 */
34
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: head/sys/kern/vfs_default.c 276192 2014-12-24 22:58:08Z rmacklem $");
36__FBSDID("$FreeBSD: head/sys/kern/vfs_default.c 276200 2014-12-25 14:44:04Z rmacklem $");
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/bio.h>
41#include <sys/buf.h>
42#include <sys/conf.h>
43#include <sys/event.h>
44#include <sys/kernel.h>

--- 357 unchanged lines hidden (view full) ---

402{
403 struct vnode *vp;
404 struct vattr vattr;
405 int error;
406
407 vp = ap->a_vp;
408 if (ap->a_fl->l_whence == SEEK_END) {
409 /*
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/bio.h>
41#include <sys/buf.h>
42#include <sys/conf.h>
43#include <sys/event.h>
44#include <sys/kernel.h>

--- 357 unchanged lines hidden (view full) ---

402{
403 struct vnode *vp;
404 struct vattr vattr;
405 int error;
406
407 vp = ap->a_vp;
408 if (ap->a_fl->l_whence == SEEK_END) {
409 /*
410 * The NFSv4 server will LOR/deadlock if a vn_lock() call
411 * is done on vp. Fortunately, vattr.va_size is only
412 * needed for SEEK_END and the NFSv4 server only uses SEEK_SET.
410 * The NFSv4 server must avoid doing a vn_lock() here, since it
411 * can deadlock the nfsd threads, due to a LOR. Fortunately
412 * the NFSv4 server always uses SEEK_SET and this code is
413 * only required for the SEEK_END case.
413 */
414 vn_lock(vp, LK_SHARED | LK_RETRY);
415 error = VOP_GETATTR(vp, &vattr, curthread->td_ucred);
416 VOP_UNLOCK(vp, 0);
417 if (error)
418 return (error);
419 } else
420 vattr.va_size = 0;

--- 867 unchanged lines hidden ---
414 */
415 vn_lock(vp, LK_SHARED | LK_RETRY);
416 error = VOP_GETATTR(vp, &vattr, curthread->td_ucred);
417 VOP_UNLOCK(vp, 0);
418 if (error)
419 return (error);
420 } else
421 vattr.va_size = 0;

--- 867 unchanged lines hidden ---