Re: Race-free unlinking of directory entries

2018-10-01 Thread Pali Rohár
On Monday 09 April 2018 12:35:54 Pali Rohár wrote: > On Monday 09 April 2018 03:24:14 Christoph Hellwig wrote: > > On Mon, Apr 09, 2018 at 12:10:09PM +0200, Pali Rohár wrote: > > > Another example: > > > > > > fd = open("/a") > > > link("/a", "/b") > > > unlink("/a") > > > > > > Calling funlink f

Re: Race-free unlinking of directory entries

2018-04-09 Thread Pali Rohár
On Monday 09 April 2018 03:24:14 Christoph Hellwig wrote: > On Mon, Apr 09, 2018 at 12:10:09PM +0200, Pali Rohár wrote: > > Another example: > > > > fd = open("/a") > > link("/a", "/b") > > unlink("/a") > > > > Calling funlink for fd should unlink "/b" or it should fail? > > It should fail, as '

Re: Race-free unlinking of directory entries

2018-04-09 Thread Christoph Hellwig
On Mon, Apr 09, 2018 at 12:10:09PM +0200, Pali Rohár wrote: > I do not think it is enough, specially in cases when hard links are in > use. Example: > > fd = open("/a") > link("/a", "/b") > link("/a", "/c") > unlink("/a") > > And now I want to call funlink for "fd". Which file should be unlinked?

Re: Race-free unlinking of directory entries

2018-04-09 Thread Pali Rohár
On Monday 09 April 2018 02:59:19 Christoph Hellwig wrote: > On Mon, Apr 09, 2018 at 09:42:41AM +0200, Pali Rohár wrote: > > Hi! I would like to remind this my older email about race free > > unlinking. Is there any plan to provide such support? > > Given that in Linux we know which directory entry

Re: Race-free unlinking of directory entries

2018-04-09 Thread Christoph Hellwig
On Mon, Apr 09, 2018 at 09:42:41AM +0200, Pali Rohár wrote: > Hi! I would like to remind this my older email about race free > unlinking. Is there any plan to provide such support? Given that in Linux we know which directory entry a given fd refers to, we shouldn't even need a new syscall, but sim

Re: Race-free unlinking of directory entries

2018-04-09 Thread Pali Rohár
Hi! I would like to remind this my older email about race free unlinking. Is there any plan to provide such support? On Wednesday 20 December 2017 20:18:44 Pali Rohár wrote: > Hi! > > Linux kernel currently does not provide any race-free way for calling > unlink() syscall on file entry which poin