Whamcloud - gitweb
LU-3647 hsm: small fixes for HSM
[fs/lustre-release.git] / lustre / llite / dir.c
index 719c8ac..ace571a 100644 (file)
@@ -1828,6 +1828,11 @@ out_rmdir:
                /* Compute the whole struct size */
                totalsize = hur_len(hur);
                OBD_FREE_PTR(hur);
+
+               /* Make sure the size is reasonable */
+               if (totalsize >= MDS_MAXREQSIZE)
+                       RETURN(-E2BIG);
+
                OBD_ALLOC_LARGE(hur, totalsize);
                if (hur == NULL)
                        RETURN(-ENOMEM);