[lkml]   [2001]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: race condition on looking up inodes

On Mon, 9 Apr 2001, warren wrote:

> Hi,
> I had post a simillar message before.
> Thanks for the replay from Albert D. Cahalan. But i found some results
> confusing me.
> For example, process 1 and process 2 run concurrently and execute the
> following system calls.
> rename("/usr/hybrid/cfg/data","/usr/mytemp/data1"); /*for process 1*/
> ----------------------------------------------------------------
> rename("/usr/mytemp/data1","/usr/test");/* for process 2*/

> ----------------------------------------------------------------
> It is possible that context switch happens when process 1 is look ing up
> the inode for "/usr/mytemp/data1" or the inode for "/usr/hybrid/cfg/data".

> It will result in diffrent behaviour for process 2 and confuses the
> application.

> If so,how does Linux solve?

Solves what, precisely? Result depends on the order of these calls. If
you don't provide any serialization - you get timing-dependent results
you were asking for. What's the problem and what behaviour do you expect?

Besides, what's the difference caused by the moment of context switch?

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:24    [W:0.031 / U:4.712 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site