Oops, I forgot to CC my last email to the mailing list; re-sending now.

On Tue, 27 Oct 2015 19:43:46 -0500 Shirish Pargaonkar
<[email protected]> wrote:
> On Tue, Oct 27, 2015 at 4:59 AM, Aurélien Aptel <[email protected]>
> wrote:  
> > Hi Shirish,
> >
> > On Mon, 26 Oct 2015 22:04:28 -0500 Shirish Pargaonkar
> > <[email protected]> wrote:  
> >> They are stored in a linked list of struct cifs_rdelem off of
> >> superblock where each element of this linked list points to a
> >> disconnected dentry.  
> >
> > This list is only used use when we mount with noserverino. It
> > doesn't work in both case anyway.  
> 
> No, that is not the case. I have tested this against a Windows 2012
> server and did not mount the shares with noserverino option.
> Since we can query info off of disconnected entires, we fill the
> inodes which get filled with correct inode info as dentires get
> spliced.  

The only function that adds elements to the rdlist is this one, and it
only does so with noserverino. I believe d_obtain_alias() doesn't store
the full path on the share associated with the disconnected entry it creates.
The full path is therefore lost and build_path_from_dentry() fails.

static struct dentry *
create_root_dis_dentry(struct super_block *sb, struct inode *rinode,
                        char *fpath)
{
        int rc;
        unsigned int xid;
        struct dentry *dentry = NULL;
        struct cifs_rdelem *rdelem = NULL;
        struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
        struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb);

        printk("create_root_dis_dentry %s, rinode %p\n", fpath, rinode);
        
        xid = get_xid();
        if (tcon->unix_ext)
                rc = cifs_get_inode_info_unix(&rinode, fpath, sb, xid);
        else
                rc = cifs_get_inode_info(&rinode, fpath, NULL, sb, xid, NULL);
        free_xid(xid);
        
        if ((rc == 0) && (rinode != NULL)) {
                dentry = d_obtain_alias(rinode);
                if (IS_ERR(dentry)) {
                        iput(rinode);
                        goto rdelem_ret;
                }

                if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM)) {

                        rdelem =
                                cifs_alloc_rdelem(fpath, dentry, rinode);
                        if (IS_ERR(rdelem))
                                goto rdelem_ret;
                        spin_lock(&cifs_sb->rtdislock);
                        list_add(&rdelem->rdlist, &cifs_sb->rtdislist);
                        spin_unlock(&cifs_sb->rtdislock);
                }
                return dentry;
        }

rdelem_ret:
        return ERR_PTR(-EACCES);
}

 
> Sorry, missed looking at the link before. yes, the same setup.
> I could never get right seutp for Samba server.  

I must be missing something because I cannot make your patch work.
We're using the exact same setup.

-- 
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG
Nürnberg)

Attachment: pgpLz_KFsJIeO.pgp
Description: OpenPGP digital signature

Reply via email to