Re: [PATCH] CIFS: Fix NT_STATUS_ACCESS_DENIED for mounts with prefixpath option

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

 



2011/8/26 Jeff Layton <jlayton@xxxxxxxxxx>:
> On Fri, 26 Aug 2011 10:52:21 +0400
> Pavel Shilovsky <piastry@xxxxxxxxxxx> wrote:
>
>> Reorganize code and make it send qpath info request only for a full
>> path (//server/share/prefixpath) rather than request for every path
>> compoment. In this case we end up with negative dentries for all
>> components except full one and we will instantiate them later if
>> such a mount is requested.
>>
>> Signed-off-by: Pavel Shilovsky <piastry@xxxxxxxxxxx>
>> ---
>>  fs/cifs/cifsfs.c  |  123 +++++++++++++++++++++++++++++++----------------------
>>  fs/cifs/cifsfs.h  |    3 +-
>>  fs/cifs/inode.c   |    7 ++-
>>  fs/cifs/readdir.c |    9 +++-
>>  4 files changed, 85 insertions(+), 57 deletions(-)
>>
>> diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
>> index 0435bb9..33a2e1e 100644
>> --- a/fs/cifs/cifsfs.c
>> +++ b/fs/cifs/cifsfs.c
>> @@ -95,14 +95,13 @@ mempool_t *smb2_mid_poolp;
>>  static struct kmem_cache *smb2_mid_cachep;
>>  #endif /* CONFIG_CIFS_SMB2 */
>>
>> -static int
>> +static void
>>  cifs_read_super(struct super_block *sb)
>>  {
>> -     struct inode *inode;
>> -     struct cifs_sb_info *cifs_sb;
>> -     int rc = 0;
>> +     struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
>>
>> -     cifs_sb = CIFS_SB(sb);
>> +     /* BB should we make this contingent on mount parm? */
>> +     sb->s_flags |= MS_NODIRATIME | MS_NOATIME;
>>
>>       if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIXACL)
>>               sb->s_flags |= MS_POSIXACL;
>> @@ -120,26 +119,6 @@ cifs_read_super(struct super_block *sb)
>>       sb->s_bdi = &cifs_sb->bdi;
>>       sb->s_blocksize = CIFS_MAX_MSGSIZE;
>>       sb->s_blocksize_bits = 14;      /* default 2**14 = CIFS_MAX_MSGSIZE */
>> -     inode = cifs_root_iget(sb);
>> -
>> -     if (IS_ERR(inode)) {
>> -             rc = PTR_ERR(inode);
>> -             inode = NULL;
>> -             goto out_no_root;
>> -     }
>> -
>> -     sb->s_root = d_alloc_root(inode);
>> -
>> -     if (!sb->s_root) {
>> -             rc = -ENOMEM;
>> -             goto out_no_root;
>> -     }
>> -
>> -     /* do that *after* d_alloc_root() - we want NULL ->d_op for root here */
>> -     if (cifs_sb_master_tcon(cifs_sb)->nocase)
>> -             sb->s_d_op = &cifs_ci_dentry_ops;
>> -     else
>> -             sb->s_d_op = &cifs_dentry_ops;
>>
>>  #ifdef CIFS_NFSD_EXPORT
>>       if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) {
>> @@ -148,14 +127,7 @@ cifs_read_super(struct super_block *sb)
>>       }
>>  #endif /* CIFS_NFSD_EXPORT */
>>
>> -     return 0;
>> -
>> -out_no_root:
>> -     cERROR(1, "cifs_read_super: get root inode failed");
>> -     if (inode)
>> -             iput(inode);
>> -
>> -     return rc;
>> +     sb->s_flags |= MS_ACTIVE;
>>  }
>>
>>  static void cifs_kill_sb(struct super_block *sb)
>> @@ -529,6 +501,17 @@ static const struct super_operations cifs_super_ops = {
>>  #endif
>>  };
>>
>> +static struct dentry *
>> +cifs_alloc_root(struct super_block *sb)
>> +{
>> +     struct qstr q;
>> +
>> +     q.name = "/";
>
>        I don't think you want a separator in the name. That seems
>        like it should be "".
>

In this case I based it on d_alloc_root() function that fills name as
"/". Why this should be ""?

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


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux