]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
2.6.22 patch added
authorGreg Kroah-Hartman <gregkh@suse.de>
Thu, 13 Dec 2007 05:16:59 +0000 (21:16 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 13 Dec 2007 05:16:59 +0000 (21:16 -0800)
queue-2.6.22/knfsd-validate-filehandle-type-in-fsid_source.patch [new file with mode: 0644]
queue-2.6.22/series

diff --git a/queue-2.6.22/knfsd-validate-filehandle-type-in-fsid_source.patch b/queue-2.6.22/knfsd-validate-filehandle-type-in-fsid_source.patch
new file mode 100644 (file)
index 0000000..dcf1fee
--- /dev/null
@@ -0,0 +1,62 @@
+From b8da0d1c27f144bce999c653467106f3f0d5a308 Mon Sep 17 00:00:00 2001
+From: Neil Brown <neilb@suse.de>
+Date: Wed, 5 Sep 2007 17:22:13 -0400
+Subject: knfsd: Validate filehandle type in fsid_source
+Message-ID: <6101e8c40712021314l74838974idc3e895c2d9c50e5@mail.gmail.com>
+
+From: Neil Brown <neilb@suse.de>
+
+patch b8da0d1c27f144bce999c653467106f3f0d5a308 in mainline.
+
+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
+UUID.
+
+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
+fsid_source.
+
+Signed-off-by: Neil Brown <neilb@suse.de>
+Cc: "Luiz Fernando N. Capitulino" <lcapitulino@gmail.com>
+Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Oliver Pintr <oliver.pntr@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/nfsd/nfsfh.c |   20 +++++++++++++++-----
+ 1 file changed, 15 insertions(+), 5 deletions(-)
+
+--- a/fs/nfsd/nfsfh.c
++++ b/fs/nfsd/nfsfh.c
+@@ -565,13 +565,23 @@ enum fsid_source fsid_source(struct svc_
+       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;
+ }
index e4014d260d94f31103c13945cd761fdf98e71530..b9308addc349da35649265fbabfe2a31fc402494 100644 (file)
@@ -27,3 +27,4 @@ rxrpc-add-missing-select-on-crypto.patch
 ipv6-restore-ipv6-when-mtu-is-big-enough.patch
 decnet-dn_nl_deladdr-almost-always-returns-no-error.patch
 bridge-lost-call-to-br_fdb_fini-in-br_init-error-path.patch
+knfsd-validate-filehandle-type-in-fsid_source.patch