diff mbox

ceph: set s_maxbytes to MAX_LFS_FILESIZE when m_max_file_size is larger than MAX_LFS_FILESIZE

Message ID 20180716101630.29270-1-cgxu519@gmx.com (mailing list archive)
State New, archived
Headers show

Commit Message

Chengguang Xu July 16, 2018, 10:16 a.m. UTC
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 <cgxu519@gmx.com>
---
 fs/ceph/mds_client.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox

Patch

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,