From patchwork Mon Jul 16 10:16:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengguang Xu X-Patchwork-Id: 10526389 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2BB5B60348 for ; Mon, 16 Jul 2018 10:17:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2149D2881B for ; Mon, 16 Jul 2018 10:17:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 149AF28825; Mon, 16 Jul 2018 10:17:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8BEE82881B for ; Mon, 16 Jul 2018 10:17:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728343AbeGPKn6 (ORCPT ); Mon, 16 Jul 2018 06:43:58 -0400 Received: from mout.gmx.net ([212.227.17.21]:56187 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727596AbeGPKn5 (ORCPT ); Mon, 16 Jul 2018 06:43:57 -0400 Received: from x201.localdomain ([220.112.58.66]) by mail.gmx.com (mrgmx101 [212.227.17.174]) with ESMTPSA (Nemesis) id 0M0cs6-1ftwNv2pTC-00unr7; Mon, 16 Jul 2018 12:17:10 +0200 From: Chengguang Xu To: ceph-devel@vger.kernel.org Cc: zyan@redhat.com, idryomov@gmail.com, Chengguang Xu Subject: [PATCH] ceph: set s_maxbytes to MAX_LFS_FILESIZE when m_max_file_size is larger than MAX_LFS_FILESIZE Date: Mon, 16 Jul 2018 18:16:30 +0800 Message-Id: <20180716101630.29270-1-cgxu519@gmx.com> X-Mailer: git-send-email 2.17.1 X-Provags-ID: V03:K1:+7ONZCeqRKHDHnjOcEBHif6eO5ie5+REHVF8MKq1obsKgfhrADN WN/3ejHs6rz8te7PxRqRm4NUj6WjjQ5sw2s4qIHrRfTNfBNq7Bv0HiD4Q7zdGg3391G4xfK IyswxemgrKpsuRmbCRqTKVsrzui5oEgSMOnO/5pbmmOBg12b4uThO/WlRjX0Ky7YCyVjot1 kdQl0r+ucv8YVP9ROKIdw== X-UI-Out-Filterresults: notjunk:1; V01:K0:pocug7CmH44=:XnEAIvFcpl7HZcW+AChFcp hB0TLnS2dJWn2QHIcR6TRx2P8JgjRdmXT/w7OnkdiSTkeyO40P8NAlyMjf6irJ/UViQEufI0f PlHbhL2dJBF6N4xffZP+xTYtyHeejuOOOxiZuAtsZPlDQeXJAeKEd+2x9rXpU9oQ6XPMPhwB1 C1ya6yBXvxTYdIdeG+2RVqCc04KH81tx27F9iw2O8s2gkXkCnHtSkdIL1dNjTyguaV06w+NIe CD4eNZmyheL0B0LdhRCaf0sOuYasgYCGjD6BiPLAmsQ6ZJn38pCyGBni+Xr07ITUUqi1Yt7D7 XKqucBhX+qlVDZTJpv/cy9/7vqIeNS6JnfalUW7Sl1lvdrfH14Fyj3wyu4afiD5nfyss96NCb cOyd9Z1LzJicqDjSdBujF1qlHMFRBR4SrPxH+9cNoVrVPg/qxql8DtTKkGU+jnFlkE663C+tr QdCxFi6e338FqKOYBDs36H6Wf4EwiO4eL8LaCtKGlYBkyGflpxY3tCB2qQ6OYRw2cDaFjwMPC KV0qMcJOFdhOPXsSdvRSXXgnfdENTHLOuix1FIukkQLi9tgaN6hiZdB2A9cvC4+v1gDF202tm lyyHMNts9ZBSsvmq2a/NclBcUB7+kgh3FebpUGF0Q0ly0aDz4NB44OpgBfvp/d4xZsl2Blxsh T78GI2nD1SUEiOu1tiCsOJ9XsFls2X/68Kfi2+Qi7qfc5/ilKCh4CPKFplANDP5mLe651Wk0A 2Nqe6yXaxS49VSY7T3WzYb98vnqD4U7nkYy47dvE6tLiHWwZnRbCnrBPp64= Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Considering 32bit kernel client, set s_maxbytes to MAX_LFS_FILESIZE when m_max_file_size is larger than MAX_LFS_FILESIZE. Signed-off-by: Chengguang Xu --- fs/ceph/mds_client.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index df0a3bb0f6a5..5b12da7ff277 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -4057,7 +4057,11 @@ void ceph_mdsc_handle_mdsmap(struct ceph_mds_client *mdsc, struct ceph_msg *msg) } else { mdsc->mdsmap = newmap; /* first mds map */ } - mdsc->fsc->sb->s_maxbytes = mdsc->mdsmap->m_max_file_size; + + if (mdsc->mdsmap->m_max_file_size <= MAX_LFS_FILESIZE) + mdsc->fsc->sb->s_maxbytes = mdsc->mdsmap->m_max_file_size; + else + mdsc->fsc->sb->s_maxbytes = MAX_LFS_FILESIZE; __wake_requests(mdsc, &mdsc->waiting_for_map); ceph_monc_got_map(&mdsc->fsc->client->monc, CEPH_SUB_MDSMAP,