exportfs: Return the minimum required handle size
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / fs / exportfs / expfs.c
index 4b6825740dd5e6cfcf38918d3c8e477a677e94a4..cfe55731b6dc4216168229a55e448ff428c8609f 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;