Project

General

Profile

Bug #8040 » instr-8040.patch

Marcel Telka, 2017-06-13 08:24 AM

View differences:

usr/src/uts/common/fs/nfs/nfs4_client.c
422 422
	mutex_exit(&rp->r_statelock);
423 423
}
424 424

  
425
extern volatile void *repro_8040_space_thread;
426

  
425 427
/*
426 428
 * Use the passed in virtual attributes to check to see whether the
427 429
 * data and metadata caches are valid, cache the new attributes, and
......
632 634

  
633 635
	mutex_exit(&rp->r_statelock);
634 636

  
637
	while (repro_8040_space_thread == curthread)
638
		delay(SEC_TO_TICK(1));
639

  
635 640
	/*
636 641
	 * If we're the recov thread, then force async nfs4_purge_caches
637 642
	 * to avoid potential deadlock.
......
1258 1263
	mutex_exit(&mi->mi_async_lock);
1259 1264
}
1260 1265

  
1266
extern volatile int repro_8040;
1267
volatile void *repro_8040_readahead_thread = NULL;
1268

  
1261 1269
int
1262 1270
nfs4_async_readahead(vnode_t *vp, u_offset_t blkoff, caddr_t addr,
1263 1271
    struct seg *seg, cred_t *cr, void (*readahead)(vnode_t *,
......
1284 1292
	if ((args = kmem_alloc(sizeof (*args), KM_NOSLEEP)) == NULL)
1285 1293
		return (-1);
1286 1294

  
1295
	if (blkoff > 163000 && repro_8040 != 0) {
1296
		repro_8040_readahead_thread = curthread;
1297
		while (repro_8040_readahead_thread == curthread)
1298
			delay(SEC_TO_TICK(1));
1299
	}
1300

  
1287 1301
	/*
1288 1302
	 * If a lock operation is pending, don't initiate any new
1289 1303
	 * readaheads.  Otherwise, bump r_count to indicate the new
usr/src/uts/common/fs/nfs/nfs4_vnops.c
10983 10983
	return (rc);
10984 10984
}
10985 10985

  
10986
volatile int repro_8040 = 0;
10987
volatile void *repro_8040_space_thread = NULL;
10988

  
10986 10989
/*
10987 10990
 * Free storage space associated with the specified vnode.  The portion
10988 10991
 * to be freed is specified by bfp->l_start and bfp->l_len (already
......
11011 11014
		if (bfp->l_len == 0) {
11012 11015
			struct vattr va;
11013 11016

  
11017
			if (repro_8040 != 0)
11018
				repro_8040_space_thread = curthread;
11019

  
11014 11020
			va.va_mask = AT_SIZE;
11015 11021
			va.va_size = bfp->l_start;
11016 11022
			error = nfs4setattr(vp, &va, 0, cr, NULL);
(1-1/2)