On Thu, Dec 22, 2016 at 01:38:17AM +0100, Mateusz Guzik wrote:
> In this particular case, what happens if the access results in a page
> fault and the area comes from a nfs mapped file? If network i/o is done
> from the same context, this should result in 'locking against myself'
> assertion failure.

I have written a program the sets a sysctl value from a memory
mapped file mounted on NFS.  As expected it panics when NET_LOCK()
is enabled.

panic: rw_enter: netlock locking against myself
Stopped at      Debugger+0x7:   leave
   TID    PID    UID     PRFLAGS     PFLAGS  CPU  COMMAND
*45785  40072      0         0x3          0    0  mmap-sysctl

ddb{0}> trace
Debugger(d09f4dbd,f57706d0,d09cc44c,f57706d0,0) at Debugger+0x7
panic(d09cc44c,d09d634f,f5770700,f57706fc,0) at panic+0x71
rw_enter(d0b4ef38,1,f5770784,d04a8b3d,d953c00c) at rw_enter+0x1b4
rw_enter_write(d0b4ef38,1,0,d03cc0ce,d0bbcf80) at rw_enter_write+0x3c
sosend(d9569730,0,0,d976aa00,0) at sosend+0xf5
nfs_send(d9569730,d957bd00,d976aa00,d953c00c,d954a5b0) at nfs_send+0x8a
nfs_request(d96fda84,6,f57708ac,0,d96fda84) at nfs_request+0x3a3
nfs_readrpc(d96fda84,f5770930,0,0,39fcef3f) at nfs_readrpc+0x14e
nfs_doio(d954a5b0,d9540738,0,2000,d9540738) at nfs_doio+0x321
nfs_bioread(d96fda84,f5770b38,0,d97fa840,d9540738) at nfs_bioread+0x4ff
nfs_read(f5770ae0,3,33,d30b5870,d9745ed4) at nfs_read+0x35
VOP_READ(d96fda84,f5770b38,0,d97fa840,d30b5870) at VOP_READ+0x3f
uvn_io(d9745ed4,f5770bc0,1,2,0) at uvn_io+0x2d5
uvn_get(d9745ed4,0,0,f5770cf8,f5770d00) at uvn_get+0x234
uvm_fault(d9581d24,8a1b1000,0,1,f5770d5c) at uvm_fault+0xf8e
trap() at trap+0x723
--- trap (number 4) ---

bluhm

Reply via email to