[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <181ED6EE-0B9F-4090-A911-B6053FF28BAC@dilger.ca>
Date: Sun, 2 Jan 2011 22:59:00 -0700
From: Andreas Dilger <adilger@...ger.ca>
To: Andreas Dilger <adilger@...ger.ca>
Cc: Ted Ts'o <tytso@....edu>, Andreas Gruenbacher <agruen@...e.de>,
Jeff Layton <jlayton@...hat.com>,
"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>,
"sfrench@...ibm.com" <sfrench@...ibm.com>,
"ffilz@...ibm.com" <ffilz@...ibm.com>,
"sandeen@...hat.com" <sandeen@...hat.com>,
"bfields@...i.umich.edu" <bfields@...i.umich.edu>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"nfsv4@...ux-nfs.org" <nfsv4@...ux-nfs.org>,
"linux-ext4@...r.kernel.org" <linux-ext4@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -V4 08/11] vfs: Add new file and directory create permission flags
Never mind, I didn't notice this was only for hard linking directories...
Cheers, Andreas
On 2011-01-02, at 22:20, Andreas Dilger <adilger@...ger.ca> wrote:
> Actually, I think it is required by POSIX that EXDEV is returned when cross-linking files. For mv calling rename() at least it uses a return EXDEV to copy the file to the target filesystem instead of just giving up and returning an error. It may be other applications like tar have a similar dependency for link().
>
> Cheers, Andreas
>
> On 2011-01-02, at 16:21, Ted Ts'o <tytso@....edu> wrote:
>
>> I was going through some old patches in the ext4 patchwork list, and
>> came across this. It looks like this patch has never been applied to
>> mainline. If it's a "clear improvement", any reason not to submit it?
>>
>> Regards,
>>
>> - Ted
>>
>> On Mon, Sep 27, 2010 at 03:14:00PM +0200, Andreas Gruenbacher wrote:
>>>
>>> Ah, you mean this:
>>>
>>> --- a/fs/namei.c
>>> +++ b/fs/namei.c
>>> @@ -2450,7 +2450,9 @@ int vfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *new_de
>>> if (!inode)
>>> return -ENOENT;
>>>
>>> - error = may_create(dir, new_dentry, S_ISDIR(inode->i_mode));
>>> + if (S_ISDIR(inode->i_mode))
>>> + return -EPERM;
>>> + error = may_create(dir, new_dentry, 0);
>>> if (error)
>>> return error;
>>>
>>> @@ -2464,8 +2466,6 @@ int vfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *new_de
>>> return -EPERM;
>>> if (!dir->i_op->link)
>>> return -EPERM;
>>> - if (S_ISDIR(inode->i_mode))
>>> - return -EPERM;
>>>
>>> error = security_inode_link(old_dentry, dir, new_dentry);
>>> if (error)
>>>
>>> This is a clear improvement; I don't think it matters that user-space will
>>> get -EPERM instead of -EXDEV when trying to hard-link a directory across
>>> devices.
>>>
>>> Thanks,
>>> Andreas
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
>> the body of a message to majordomo@...r.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
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