Commit:     b8da0d1c27f144bce999c653467106f3f0d5a308
Parent:     a1033be72cdb053e182bb41e302a1c11e72b68bb
Author:     Neil Brown <[EMAIL PROTECTED]>
AuthorDate: Wed Sep 5 17:22:13 2007 -0400
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Sep 10 18:57:47 2007 -0700

    knfsd: Validate filehandle type in fsid_source
    fsid_source decided where to get the 'fsid' number to
    return for a GETATTR based on the type of filehandle.
    It can be from the device, from the fsid, or from the
    It is possible for the filehandle to be inconsistent
    with the export information, so make sure the export information
    actually has the info implied by the value returned by
    Signed-off-by: Neil Brown <[EMAIL PROTECTED]>
    Cc: "Luiz Fernando N. Capitulino" <[EMAIL PROTECTED]>
    Signed-off-by: "J. Bruce Fields" <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 fs/nfsd/nfsfh.c |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c
index 0eb464a..7011d62 100644
--- a/fs/nfsd/nfsfh.c
+++ b/fs/nfsd/nfsfh.c
@@ -566,13 +566,23 @@ enum fsid_source fsid_source(struct svc_fh *fhp)
        case FSID_DEV:
        case FSID_ENCODE_DEV:
        case FSID_MAJOR_MINOR:
-               return FSIDSOURCE_DEV;
+               if (fhp->fh_export->ex_dentry->d_inode->i_sb->s_type->fs_flags
+                   & FS_REQUIRES_DEV)
+                       return FSIDSOURCE_DEV;
+               break;
        case FSID_NUM:
-               return FSIDSOURCE_FSID;
-       default:
                if (fhp->fh_export->ex_flags & NFSEXP_FSID)
                        return FSIDSOURCE_FSID;
-               else
-                       return FSIDSOURCE_UUID;
+               break;
+       default:
+               break;
+       /* either a UUID type filehandle, or the filehandle doesn't
+        * match the export.
+        */
+       if (fhp->fh_export->ex_flags & NFSEXP_FSID)
+               return FSIDSOURCE_FSID;
+       if (fhp->fh_export->ex_uuid)
+               return FSIDSOURCE_UUID;
+       return FSIDSOURCE_DEV;
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to