Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
[cascardo/linux.git] / fs / ocfs2 / export.c
index 5dbc306..254652a 100644 (file)
@@ -197,8 +197,12 @@ static int ocfs2_encode_fh(struct dentry *dentry, u32 *fh_in, int *max_len,
                   dentry->d_name.len, dentry->d_name.name,
                   fh, len, connectable);
 
-       if (len < 3 || (connectable && len < 6)) {
-               mlog(ML_ERROR, "fh buffer is too small for encoding\n");
+       if (connectable && (len < 6)) {
+               *max_len = 6;
+               type = 255;
+               goto bail;
+       } else if (len < 3) {
+               *max_len = 3;
                type = 255;
                goto bail;
        }