[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <E1MsDQ6-0001cY-92@pomaz-ex.szeredi.hu>
Date: Mon, 28 Sep 2009 12:25:26 +0200
From: Miklos Szeredi <miklos@...redi.hu>
To: Valdis.Kletnieks@...edu
CC: linux@...blig.org, miklos@...redi.hu, agruen@...e.de,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] vfs: new O_NODE open flag
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-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists