]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/exportfs/expfs.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
[karo-tx-linux.git] / fs / exportfs / expfs.c
index 4b6825740dd5e6cfcf38918d3c8e477a677e94a4..b05acb7961355dfb680e49f3145a11065f6ac851 100644 (file)
@@ -320,9 +320,14 @@ static int export_encode_fh(struct dentry *dentry, struct fid *fid,
        struct inode * inode = dentry->d_inode;
        int len = *max_len;
        int type = FILEID_INO32_GEN;
-       
-       if (len < 2 || (connectable && len < 4))
+
+       if (connectable && (len < 4)) {
+               *max_len = 4;
+               return 255;
+       } else if (len < 2) {
+               *max_len = 2;
                return 255;
+       }
 
        len = 2;
        fid->i32.ino = inode->i_ino;
@@ -369,6 +374,8 @@ struct dentry *exportfs_decode_fh(struct vfsmount *mnt, struct fid *fid,
        /*
         * Try to get any dentry for the given file handle from the filesystem.
         */
+       if (!nop || !nop->fh_to_dentry)
+               return ERR_PTR(-ESTALE);
        result = nop->fh_to_dentry(mnt->mnt_sb, fid, fh_len, fileid_type);
        if (!result)
                result = ERR_PTR(-ESTALE);