[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230102143538.GA8886@hamza-HP-ZBook-15-G3>
Date: Mon, 2 Jan 2023 19:35:38 +0500
From: Ameer Hamza <ahamza@...ystems.com>
To: David Laight <David.Laight@...LAB.COM>
Cc: "viro@...iv.linux.org.uk" <viro@...iv.linux.org.uk>,
"jlayton@...nel.org" <jlayton@...nel.org>,
"chuck.lever@...cle.com" <chuck.lever@...cle.com>,
"arnd@...db.de" <arnd@...db.de>,
"guoren@...nel.org" <guoren@...nel.org>,
"palmer@...osinc.com" <palmer@...osinc.com>,
"f.fainelli@...il.com" <f.fainelli@...il.com>,
"slark_xiao@....com" <slark_xiao@....com>,
"richard.henderson@...aro.org" <richard.henderson@...aro.org>,
"ink@...assic.park.msu.ru" <ink@...assic.park.msu.ru>,
"mattst88@...il.com" <mattst88@...il.com>,
"James.Bottomley@...senPartnership.com"
<James.Bottomley@...senPartnership.com>,
"deller@....de" <deller@....de>,
"davem@...emloft.net" <davem@...emloft.net>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
"awalker@...ystems.com" <awalker@...ystems.com>,
"sparclinux@...r.kernel.org" <sparclinux@...r.kernel.org>,
"linux-parisc@...r.kernel.org" <linux-parisc@...r.kernel.org>,
"linux-alpha@...r.kernel.org" <linux-alpha@...r.kernel.org>
Subject: Re: [PATCH v2] Add new open(2) flag - O_EMPTY_PATH
On Mon, Jan 02, 2023 at 02:01:38PM +0000, David Laight wrote:
> From: Ameer Hamza
> > Sent: 31 December 2022 23:56
> >
> > This patch adds a new flag O_EMPTY_PATH that allows openat and open
> > system calls to open a file referenced by fd if the path is empty,
> > and it is very similar to the FreeBSD O_EMPTY_PATH flag. This can be
> > beneficial in some cases since it would avoid having to grant /proc
> > access to things like samba containers for reopening files to change
> > flags in a race-free way.
> >
>
> But what does it do?
> (Apart from add code to a common kernel code path.)
>
> David
It can convert an O_PATH descriptor to one suitable for r/w work.
If we already have a file descriptor: {opath_fd = open(<path>, O_PATH);}, we can call {openat(opath_fd, "", O_EMPTY_PATH | O_RDWR)} instead of going through procfs {open(/proc/self/fd/<opath_fd>, O_RDWR)}.
>
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)
>
Powered by blists - more mailing lists