Semaphore should be released in get_super
Hello,
Probably I found a bug in get_super() proc. I think there should be semaphore released before return sb. I attached diff file.
regards,
sdrb
fs/super.c +3 -1
@@ -473,8 +473,10 @@ rescan:spin_unlock (&sb_lock);down_read (&sb->s_umount);/* still alive? */ -if (sb->s_root) +if (sb->s_root) { +up_read (&sb->s_umount);return sb; + }up_read (&sb->s_umount);/* nope, got unmounted */ spin_lock (&sb_lock);
Quoted 4 lines · sdrb
Hello,
Probably I found a bug in
get_super()proc. I think there should be semaphore released before return sb.
That's the point of get_super(). It's supposed to return with the semaphore held. Users call drop_super() later which releases the semaphore.
Signature · 4 lines
Matthew Wilcox Intel Open Source Technology Centre "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step."
Quoted 9 lines · Matthew Wilcox
Quoted 4 lines · sdrb
Hello,
Probably I found a bug in
get_super()proc. I think there should be semaphore released before return sb.That's the point of
get_super(). It's supposed to return with the semaphore held. Users calldrop_super()later which releases the semaphore.
Sorry, my mistake - I noticed drop_user() just a few minutes after I sent a post :)