[lkml]   [2001]   [May]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [Patch] deadlock on write in tmpfs

On Tue, May 01, 2001 at 03:39:47PM +0200, Christoph Rohland wrote:
> tmpfs deadlocks when writing into a file from a mapping of the same
> file.
> So I see two choices:
> 1) Do not serialise the whole of shmem_getpage_locked but protect
> critical pathes with the spinlock and do retries after sleeps
> 2) Add another semaphore to serialize shmem_getpage_locked and
> shmem_truncate
> I tried some time to get 1) done but the retry logic became way too
> complicated. So the attached patch implements 2)
> I still think it's ugly to add another semaphore, but it works.

If the locking is for a completely different reason, then a different
semaphore is quite appropriate. In this case you're trying to lock
the shm internal info structures, which is quite different from the
sort of inode locking which the VFS tries to do itself, so the new
semaphore appears quite clean --- and definitely needed.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:17    [W:0.049 / U:0.464 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site