All of lore.kernel.org
 help / color / mirror / Atom feed
* [CHECKER] deadlock in 2.5.62/fs/lockd/svc*.c?
@ 2003-03-22 10:10 Dawson Engler
  0 siblings, 0 replies; only message in thread
From: Dawson Engler @ 2003-03-22 10:10 UTC (permalink / raw)
  To: linux-kernel; +Cc: Dawson Engler

Hi All,

here's a more interesting potential deadlock in  the 
	2.5.62/fs/lockd/svc*.c
code that requires the miscordination of three threads.  It might be
a false because of 
        1. infeasible callchain path or 

        2. the two struct nlm_file.f_sema pointers cannot actually point
	to the same object.

It requires three threads: 
        thread 1: acquires nlm_file_sema then tries to get file->f_sema
        thread 2: acquires file->f_sema and tries to get nlm_host_sema
        thread 3: acquires nlm_host_sema and tries to get nlm_file_sema

Any feedback on this one would be great.

Dawson


BUG: ERROR: 3 thread global-global deadlock.
   <&nlm_file_sema>-><&nlm_host_sema> occurred 4 times
   <&nlm_host_sema>-><&nlm_file_sema> occurred 5 times


Plausible chain
   thread 1: <&nlm_file_sema,struct nlm_file.f_sema>
    depth = 3:
        2.5.62/fs/lockd/svcsubs.c:nlm_traverse_files:218

        down(&nlm_file_sema);

           ->2.5.62/fs/lockd/svcsubs.c:nlm_traverse_files:218
           	->nlm_traverse_files:224
           	->nlm_inspect_file:202
           	->end=fs/lockd/svclock.c:nlmsvc_traverse_blocks:274:down

        	down(&file->f_sema);

Seems like a plausible chain.
   thread 2: <struct nlm_file.f_sema,&nlm_host_sema>
    depth = 4:
        2.5.62/fs/lockd/svclock.c:nlmsvc_lock:309

        /* Lock file against concurrent access */
        down(&file->f_sema);


           ->2.5.62/fs/lockd/svclock.c:nlmsvc_lock:309
           	->nlmsvc_lock:351
           	->nlmsvc_create_block:179
           		->2.5.62/fs/lockd/host.c:nlmclnt_lookup_host:44
           		    ->end=nlm_lookup_host:74:down

        			/* Lock hash table */
        			down(&nlm_host_sema);

Seems reasonable.
  <&nlm_host_sema>-><&nlm_file_sema> =
    depth = 4:
        2.5.62/fs/lockd/host.c:nlm_lookup_host:74
           /* Lock hash table */
           down(&nlm_host_sema);

           ->2.5.62/fs/lockd/host.c:nlm_lookup_host:74
           ->nlm_lookup_host:77
           ->nlm_gc_hosts:319
           ->/u2/engler/mc/oses/linux/linux-2.5.62/fs/lockd/svcsubs.c:nlmsvc_mark_resources:279
           ->end=nlm_traverse_files:218:down
           ->2.5.62/fs/lockd/svcsubs.c:nlm_traverse_files:218

        	down(&nlm_file_sema);



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-03-22  9:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-22 10:10 [CHECKER] deadlock in 2.5.62/fs/lockd/svc*.c? Dawson Engler

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.