exportfs: Return the minimum required handle size
[deliverable/linux.git] / fs / gfs2 / export.c
index 9023db8184f91ba758bae3c2a981e0a8180d2dfb..b5a5e60df0d5294ea237da99a231416fe800e5b4 100644 (file)
@@ -36,9 +36,13 @@ static int gfs2_encode_fh(struct dentry *dentry, __u32 *p, int *len,
        struct super_block *sb = inode->i_sb;
        struct gfs2_inode *ip = GFS2_I(inode);
 
-       if (*len < GFS2_SMALL_FH_SIZE ||
-           (connectable && *len < GFS2_LARGE_FH_SIZE))
+       if (connectable && (*len < GFS2_LARGE_FH_SIZE)) {
+               *len = GFS2_LARGE_FH_SIZE;
                return 255;
+       } else if (*len < GFS2_SMALL_FH_SIZE) {
+               *len = GFS2_SMALL_FH_SIZE;
+               return 255;
+       }
 
        fh[0] = cpu_to_be32(ip->i_no_formal_ino >> 32);
        fh[1] = cpu_to_be32(ip->i_no_formal_ino & 0xFFFFFFFF);
This page took 0.034801 seconds and 5 git commands to generate.