Commit e55c4476 authored by James Nunez's avatar James Nunez Committed by Greg Kroah-Hartman

staging/lustre/hsm: HSM requests not delivered

The total size of an HSM archive request may exceed the
desired (LNET) message. When this happens, it can hang
the client and not allow the archive request to succeed.

Before we know the total size of the hsm_action_items, we
need to limit the size of the reguest. Doing this limits
the number of items that can be sent in one archive request.
We'e reduced the size allowed for the user archive request
to MDS_MAXREQSIZE/3.
Signed-off-by: default avatarJames Nunez <james.a.nunez@intel.com>
Reviewed-on: http://review.whamcloud.com/9393
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4639Reviewed-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Reviewed-by: default avatarJinshan Xiong <jinshan.xiong@intel.com>
Signed-off-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5d0d422e
...@@ -264,6 +264,8 @@ ...@@ -264,6 +264,8 @@
#define LDLM_MAXREQSIZE (5 * 1024) #define LDLM_MAXREQSIZE (5 * 1024)
#define LDLM_MAXREPSIZE (1024) #define LDLM_MAXREPSIZE (1024)
#define MDS_MAXREQSIZE (5 * 1024) /* >= 4736 */
#define OST_MAXREQSIZE (5 * 1024) #define OST_MAXREQSIZE (5 * 1024)
/* Macro to hide a typecast. */ /* Macro to hide a typecast. */
......
...@@ -1804,6 +1804,11 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1804,6 +1804,11 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
/* Compute the whole struct size */ /* Compute the whole struct size */
totalsize = hur_len(hur); totalsize = hur_len(hur);
OBD_FREE_PTR(hur); OBD_FREE_PTR(hur);
/* Final size will be more than double totalsize */
if (totalsize >= MDS_MAXREQSIZE / 3)
return -E2BIG;
OBD_ALLOC_LARGE(hur, totalsize); OBD_ALLOC_LARGE(hur, totalsize);
if (hur == NULL) if (hur == NULL)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment