lkml.org 
[lkml]   [2014]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectBUG?: super.c:sget spin_lock not released?
From
Hello,

I have recently been playing around with writing a custom filesystem
for Linux, and have been reading the source of other filesystems, and
the functions they call into the linux kernel.
While looking at the function sget in super.c I found something strange.

before if(test) it takes a spinlock, however there seems to be two
cases where it does not unlock it.
(Kernel 3.14, super.c line 441)

One:
if(!grab_super(old)) goto retry;
Will jump to before spin_lock(), without releasing it first.

Two:
And if it finds an old sb, it will return without releasing the lock.


This code seems to be the same in 3.14 and in 2.6
I might just be missing how the spin_lock works, and if so I'm sorry.
But this seems really strange to me. Would this not potentially cause
a deadlock on sb_lock?


\
 
 \ /
  Last update: 2014-05-30 01:21    [W:0.030 / U:0.540 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site