From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933383AbbI3NFW (ORCPT ); Wed, 30 Sep 2015 09:05:22 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:59001 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932795AbbI3NE6 (ORCPT ); Wed, 30 Sep 2015 09:04:58 -0400 From: Arnd Bergmann To: ceph-devel@vger.kernel.org Cc: y2038@lists.linaro.org, Ilya Dryomov , "Yan, Zheng" , Sage Weil , linux-kernel@vger.kernel.org Subject: [PATCH] ceph: fix message length computation Date: Wed, 30 Sep 2015 15:04:42 +0200 Message-ID: <9959810.KasB66Ks40@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:ClapqkKkE01l1Fv0QTjR3ysOx3kmDQhsHRtpGBnYIAsMqzG7lux 5CWQwiaTmHN6JJl1AG5QEn96HerNMr6+UaN9e3WKTHoMgelNIAaO2dSBteXOW+kCuERvQfZ 4RYPFb/IFAC5YHOe4wsKrMWdPHe8VUmtbvMQlotv8e+za/9hXEIX7Ze3GzoodG1AEqKQNoD HVcT9aGZVRDpx+PYOWIqw== X-UI-Out-Filterresults: notjunk:1;V01:K0:fnQ9tza+/VU=:OGSHzfmihf+J2D6bzI36h2 r4kxQIO4hUXlprdqk3cQP0pHIeLdQBQ4ZPXMvSVAyhgct31j3wpPdX2zvnqy+ue3TdnA2oM2V Zv3/hV0dG8A26JVriOILQLGl/WIs2uajex8Hheoyhy44F9CDaN5LX7BmnfPWsj1fuFUA4Lp91 FJfIxYQDUXted2LSD/Y2UIXg2BJ8ndGhL7TWNHPEXCIEKXI9P0bUad7HCwrxZz4LawUlY0e// p8/d09dq1EIFB/ONtW/ZNJyZTV9+pcCUyfAxt6PCbtDWVkwclJGpT6Vjs9TbQnlFztI7iC/RP N/a1qPBuui87J1Nei9cqDEviVGtkDCiMXtwl/pKyST78J/be8qtpN42TiQ5f1pp9TcBw3knMl 2CMSJui6fU8ZpKSp9kYrwfv45ggt35PTxg+I+h0mJ3iDWwiRMvAwRyiTp91+bsojjz/2YA0Y7 B2tWDEw0Ia/VdVWeV9q5tOGXQTjNVAH5zhPckfxZKUikwTXXuAc43l6B5wQ07xgOWwE2d/Akn dFjRrioDxosW5rsd3NU/kv7Vr9k3jU29plGP+YWlPOI+8lpjhQmpxgeaZeL8ROAdTBWZEgpPM eK4C700Xzcbng3Pv6mhy93eT4KPM1n0MjVhvCwi471WA06eHWHYj5VZ2D1G0bPxGotMqY+Dhc fTvuJHv38PheAMb1zGGliJCL+qMvTvc5X369j7oWPO2i7nY8UbXo0PpkCLtU9yW1ZHp5d+uc6 Q4rqzeg1iWggB8fk Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org create_request_message() computes the maximum length of a message, but uses the wrong type for the time stamp: sizeof(struct timespec) may be 8 or 16 depending on the architecture, while sizeof(struct ceph_timespec) is always 8, and that is what gets put into the message. Found while auditing the uses of timespec for y2038 problems. Signed-off-by: Arnd Bergmann Fixes: b8e69066d8af ("ceph: include time stamp in every MDS request") --- diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 51cb02da75d9..fe2c982764e7 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -1935,7 +1935,7 @@ static struct ceph_msg *create_request_message(struct ceph_mds_client *mdsc, len = sizeof(*head) + pathlen1 + pathlen2 + 2*(1 + sizeof(u32) + sizeof(u64)) + - sizeof(struct timespec); + sizeof(struct ceph_timespec); /* calculate (max) length for cap releases */ len += sizeof(struct ceph_mds_request_release) *