Message ID | 49BFD370.2050606@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tue, 17 Mar 2009 19:44:32 +0300 Igor Mammedov <niallain@gmail.com> wrote: > From 73352e0f001d32812f9b18ae85aec35026b7a194 Mon Sep 17 00:00:00 2001 > From: Igor Mammedov <niallain@gmail.com> > Date: Tue, 17 Mar 2009 19:00:30 +0300 > Subject: [PATCH 3/3] [CIFS] Enable dfs submounts to handle remote referrals. > > Having remote dfs root support in cifs_mount, we can > afford to pass into it UNC that is remote. > > Signed-off-by: Igor Mammedov <niallain@gmail.com> > --- > fs/cifs/cifs_dfs_ref.c | 32 ++++++++++++++------------------ > 1 files changed, 14 insertions(+), 18 deletions(-) > > diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c > index 5fdbf8a..896b08f 100644 > --- a/fs/cifs/cifs_dfs_ref.c > +++ b/fs/cifs/cifs_dfs_ref.c > @@ -341,27 +341,23 @@ cifs_dfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd) > > for (i = 0; i < num_referrals; i++) { > dump_referral(referrals+i); > - /* connect to a storage node */ > - if (referrals[i].flags & DFSREF_STORAGE_SERVER) { > - int len; > - len = strlen(referrals[i].node_name); > - if (len < 2) { > - cERROR(1, ("%s: Net Address path too short: %s", > + /* connect to a node */ > + int len; > + len = strlen(referrals[i].node_name); > + if (len < 2) { > + cERROR(1, ("%s: Net Address path too short: %s", > __func__, referrals[i].node_name)); > - rc = -EINVAL; > - goto out_err; > - } > - mnt = cifs_dfs_do_refmount(nd->path.mnt, > - nd->path.dentry, > - referrals + i); > - cFYI(1, ("%s: cifs_dfs_do_refmount:%s , mnt:%p", > - __func__, > + rc = -EINVAL; > + goto out_err; > + } > + mnt = cifs_dfs_do_refmount(nd->path.mnt, > + nd->path.dentry, referrals + i); > + cFYI(1, ("%s: cifs_dfs_do_refmount:%s , mnt:%p", __func__, > referrals[i].node_name, mnt)); > > - /* complete mount procedure if we accured submount */ > - if (!IS_ERR(mnt)) > - break; > - } > + /* complete mount procedure if we accured submount */ > + if (!IS_ERR(mnt)) > + break; > } > > /* we need it cause for() above could exit without valid submount */ Looks fine, though obviously patch #2 needs to go in first.
I merged your updated patch 2 (patch 1 was merged earlier), but was not clear in the following patch (patch 3) why we no longer need to check flags for DFSREF_STORAGE_SERVER, are other types (both DFSREF_REFERRAL_SERVER and DFSREF_TARGET_FAILBACK) now ok and do not require special handling (I wasn't sure about what TARGET_FAILBACK does). On Fri, Mar 27, 2009 at 11:43 AM, Jeff Layton <jlayton@redhat.com> wrote: > On Tue, 17 Mar 2009 19:44:32 +0300 > Igor Mammedov <niallain@gmail.com> wrote: > >> From 73352e0f001d32812f9b18ae85aec35026b7a194 Mon Sep 17 00:00:00 2001 >> From: Igor Mammedov <niallain@gmail.com> >> Date: Tue, 17 Mar 2009 19:00:30 +0300 >> Subject: [PATCH 3/3] [CIFS] Enable dfs submounts to handle remote referrals. >> >> Having remote dfs root support in cifs_mount, we can >> afford to pass into it UNC that is remote. >> >> Signed-off-by: Igor Mammedov <niallain@gmail.com> >> --- >> Â fs/cifs/cifs_dfs_ref.c | Â 32 ++++++++++++++------------------ >> Â 1 files changed, 14 insertions(+), 18 deletions(-) >> >> diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c >> index 5fdbf8a..896b08f 100644 >> --- a/fs/cifs/cifs_dfs_ref.c >> +++ b/fs/cifs/cifs_dfs_ref.c >> @@ -341,27 +341,23 @@ cifs_dfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd) >> >> Â Â Â for (i = 0; i < num_referrals; i++) { >> Â Â Â Â Â Â Â dump_referral(referrals+i); >> - Â Â Â Â Â Â /* connect to a storage node */ >> - Â Â Â Â Â Â if (referrals[i].flags & DFSREF_STORAGE_SERVER) { >> - Â Â Â Â Â Â Â Â Â Â int len; >> - Â Â Â Â Â Â Â Â Â Â len = strlen(referrals[i].node_name); >> - Â Â Â Â Â Â Â Â Â Â if (len < 2) { >> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â cERROR(1, ("%s: Net Address path too short: %s", >> + Â Â Â Â Â Â /* connect to a node */ >> + Â Â Â Â Â Â int len; >> + Â Â Â Â Â Â len = strlen(referrals[i].node_name); >> + Â Â Â Â Â Â if (len < 2) { >> + Â Â Â Â Â Â Â Â Â Â cERROR(1, ("%s: Net Address path too short: %s", >> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â __func__, referrals[i].node_name)); >> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â rc = -EINVAL; >> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â goto out_err; >> - Â Â Â Â Â Â Â Â Â Â } >> - Â Â Â Â Â Â Â Â Â Â mnt = cifs_dfs_do_refmount(nd->path.mnt, >> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â nd->path.dentry, >> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â referrals + i); >> - Â Â Â Â Â Â Â Â Â Â cFYI(1, ("%s: cifs_dfs_do_refmount:%s , mnt:%p", >> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â __func__, >> + Â Â Â Â Â Â Â Â Â Â rc = -EINVAL; >> + Â Â Â Â Â Â Â Â Â Â goto out_err; >> + Â Â Â Â Â Â } >> + Â Â Â Â Â Â mnt = cifs_dfs_do_refmount(nd->path.mnt, >> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â nd->path.dentry, referrals + i); >> + Â Â Â Â Â Â cFYI(1, ("%s: cifs_dfs_do_refmount:%s , mnt:%p", __func__, >> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â referrals[i].node_name, mnt)); >> >> - Â Â Â Â Â Â Â Â Â Â /* complete mount procedure if we accured submount */ >> - Â Â Â Â Â Â Â Â Â Â if (!IS_ERR(mnt)) >> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â break; >> - Â Â Â Â Â Â } >> + Â Â Â Â Â Â /* complete mount procedure if we accured submount */ >> + Â Â Â Â Â Â if (!IS_ERR(mnt)) >> + Â Â Â Â Â Â Â Â Â Â break; >> Â Â Â } >> >> Â Â Â /* we need it cause for() above could exit without valid submount */ > > > Looks fine, though obviously patch #2 needs to go in first. > > -- > Jeff Layton <jlayton@redhat.com> >
Steve French wrote: > I merged your updated patch 2 (patch 1 was merged earlier), but was > not clear in the following patch (patch 3) why we no longer need to > check flags for DFSREF_STORAGE_SERVER, are other types (both > DFSREF_REFERRAL_SERVER and DFSREF_TARGET_FAILBACK) now ok and do not > require special handling (I wasn't sure about what TARGET_FAILBACK > does). Now cifs supports only V3 style referrals only and by ms docs TARGET_FAILBACK should be ignored by a client except for V4 referrals. So we could ignore it for a while till we decide to add support for V4 referrals. > > On Fri, Mar 27, 2009 at 11:43 AM, Jeff Layton <jlayton@redhat.com> wrote: >> On Tue, 17 Mar 2009 19:44:32 +0300 >> Igor Mammedov <niallain@gmail.com> wrote: >> >>> From 73352e0f001d32812f9b18ae85aec35026b7a194 Mon Sep 17 00:00:00 2001 >>> From: Igor Mammedov <niallain@gmail.com> >>> Date: Tue, 17 Mar 2009 19:00:30 +0300 >>> Subject: [PATCH 3/3] [CIFS] Enable dfs submounts to handle remote referrals. >>> >>> Having remote dfs root support in cifs_mount, we can >>> afford to pass into it UNC that is remote. >>> >>> Signed-off-by: Igor Mammedov <niallain@gmail.com> >>> --- >>> fs/cifs/cifs_dfs_ref.c | 32 ++++++++++++++------------------ >>> 1 files changed, 14 insertions(+), 18 deletions(-) >>> >>> diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c >>> index 5fdbf8a..896b08f 100644 >>> --- a/fs/cifs/cifs_dfs_ref.c >>> +++ b/fs/cifs/cifs_dfs_ref.c >>> @@ -341,27 +341,23 @@ cifs_dfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd) >>> >>> for (i = 0; i < num_referrals; i++) { >>> dump_referral(referrals+i); >>> - /* connect to a storage node */ >>> - if (referrals[i].flags & DFSREF_STORAGE_SERVER) { >>> - int len; >>> - len = strlen(referrals[i].node_name); >>> - if (len < 2) { >>> - cERROR(1, ("%s: Net Address path too short: %s", >>> + /* connect to a node */ >>> + int len; >>> + len = strlen(referrals[i].node_name); >>> + if (len < 2) { >>> + cERROR(1, ("%s: Net Address path too short: %s", >>> __func__, referrals[i].node_name)); >>> - rc = -EINVAL; >>> - goto out_err; >>> - } >>> - mnt = cifs_dfs_do_refmount(nd->path.mnt, >>> - nd->path.dentry, >>> - referrals + i); >>> - cFYI(1, ("%s: cifs_dfs_do_refmount:%s , mnt:%p", >>> - __func__, >>> + rc = -EINVAL; >>> + goto out_err; >>> + } >>> + mnt = cifs_dfs_do_refmount(nd->path.mnt, >>> + nd->path.dentry, referrals + i); >>> + cFYI(1, ("%s: cifs_dfs_do_refmount:%s , mnt:%p", __func__, >>> referrals[i].node_name, mnt)); >>> >>> - /* complete mount procedure if we accured submount */ >>> - if (!IS_ERR(mnt)) >>> - break; >>> - } >>> + /* complete mount procedure if we accured submount */ >>> + if (!IS_ERR(mnt)) >>> + break; >>> } >>> >>> /* we need it cause for() above could exit without valid submount */ >> >> Looks fine, though obviously patch #2 needs to go in first. >> >> -- >> Jeff Layton <jlayton@redhat.com> >> > > >
>From 73352e0f001d32812f9b18ae85aec35026b7a194 Mon Sep 17 00:00:00 2001 From: Igor Mammedov <niallain@gmail.com> Date: Tue, 17 Mar 2009 19:00:30 +0300 Subject: [PATCH 3/3] [CIFS] Enable dfs submounts to handle remote referrals. Having remote dfs root support in cifs_mount, we can afford to pass into it UNC that is remote. Signed-off-by: Igor Mammedov <niallain@gmail.com> --- fs/cifs/cifs_dfs_ref.c | 32 ++++++++++++++------------------ 1 files changed, 14 insertions(+), 18 deletions(-) diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c index 5fdbf8a..896b08f 100644 --- a/fs/cifs/cifs_dfs_ref.c +++ b/fs/cifs/cifs_dfs_ref.c @@ -341,27 +341,23 @@ cifs_dfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd) for (i = 0; i < num_referrals; i++) { dump_referral(referrals+i); - /* connect to a storage node */ - if (referrals[i].flags & DFSREF_STORAGE_SERVER) { - int len; - len = strlen(referrals[i].node_name); - if (len < 2) { - cERROR(1, ("%s: Net Address path too short: %s", + /* connect to a node */ + int len; + len = strlen(referrals[i].node_name); + if (len < 2) { + cERROR(1, ("%s: Net Address path too short: %s", __func__, referrals[i].node_name)); - rc = -EINVAL; - goto out_err; - } - mnt = cifs_dfs_do_refmount(nd->path.mnt, - nd->path.dentry, - referrals + i); - cFYI(1, ("%s: cifs_dfs_do_refmount:%s , mnt:%p", - __func__, + rc = -EINVAL; + goto out_err; + } + mnt = cifs_dfs_do_refmount(nd->path.mnt, + nd->path.dentry, referrals + i); + cFYI(1, ("%s: cifs_dfs_do_refmount:%s , mnt:%p", __func__, referrals[i].node_name, mnt)); - /* complete mount procedure if we accured submount */ - if (!IS_ERR(mnt)) - break; - } + /* complete mount procedure if we accured submount */ + if (!IS_ERR(mnt)) + break; } /* we need it cause for() above could exit without valid submount */ -- 1.6.0.2