]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/nfs/nfs4filelayout.c
Merge branch 'kvm-updates/3.2' of git://git.kernel.org/pub/scm/virt/kvm/kvm
[karo-tx-linux.git] / fs / nfs / nfs4filelayout.c
index 09119418402fe0d386b26a89fdb5bd103eec60c4..a62d36b9a99ebb912286a8fcf87f425e6b06f203 100644 (file)
@@ -31,6 +31,7 @@
 
 #include <linux/nfs_fs.h>
 #include <linux/nfs_page.h>
+#include <linux/module.h>
 
 #include "internal.h"
 #include "nfs4filelayout.h"
@@ -449,9 +450,8 @@ filelayout_check_layout(struct pnfs_layout_hdr *lo,
 
        fl->dsaddr = dsaddr;
 
-       if (fl->first_stripe_index < 0 ||
-           fl->first_stripe_index >= dsaddr->stripe_count) {
-               dprintk("%s Bad first_stripe_index %d\n",
+       if (fl->first_stripe_index >= dsaddr->stripe_count) {
+               dprintk("%s Bad first_stripe_index %u\n",
                                __func__, fl->first_stripe_index);
                goto out_put;
        }
@@ -552,7 +552,7 @@ filelayout_decode_layout(struct pnfs_layout_hdr *flo,
 
        /* Note that a zero value for num_fh is legal for STRIPE_SPARSE.
         * Futher checking is done in filelayout_check_layout */
-       if (fl->num_fh < 0 || fl->num_fh >
+       if (fl->num_fh >
            max(NFS4_PNFS_MAX_STRIPE_CNT, NFS4_PNFS_MAX_MULTI_CNT))
                goto out_err;