Re: [PATCH] vfs: new O_NODE open flag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 25 Sep 2009, Valdis.Kletnieks wrote:
> On Fri, 25 Sep 2009 19:35:23 BST, "Dr. David Alan Gilbert" said:
> 
> > I know it's not possible without this flag, my interest is whether
> > it would be possible WITH this flag to promote an fd opened with the
> > O_NODE to a normal fd, guaranteeing that it's still operating on the
> > same object.
> 
> Well, maybe the question is if we should treat "promote" differently than
> "re-open"?
> 
> (And now I'm wondering what happens if you dup() one of these beasts....)

dup() only duplicates _references_ to an open file, it does not create
a new file.  The same applies to fork().

BTW I just checked, and it is possible to re-open or promote an fd
opened with O_NODE like this:

	char tmp[64];

	fd = open(filename, O_NODE | O_NOACCESS);
	/* ... */
	sprintf(tmp, "/proc/self/fd/%i", fd);
	fd_rw = open(tmp, O_RDWR);

Now fd_rw is guaranteed to refer to the same inode as fd.

Thanks,
Miklos
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux