Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1697291
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 07/20] staging: lustre: lov: Ensure correct operation for large object sizes |
| Date | 2017-07-26 17:30 +0200 |
| Message-ID | <u7wq6-23J-31@gated-at.bofh.it> (permalink) |
| References | <u7wq5-23J-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Nathaniel Clark <nathaniel.l.clark@intel.com>
If a backing filesystem (ZFS) returns that it supports very large
(LLONG_MAX) object sizes, that should be correctly supported. This
fixes the check for unitialized stripe_maxbytes in
lsm_unpackmd_common(), so that ZFS can return LLONG_MAX and it will be
okay. This issue is excersized by writing to or past the 2TB boundry
of a singly stripped file.
Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7890
Reviewed-on: http://review.whamcloud.com/19066
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
drivers/staging/lustre/lustre/lov/lov_ea.c | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/lustre/lustre/lov/lov_ea.c b/drivers/staging/lustre/lustre/lov/lov_ea.c
index ac0bf64..2a8fee8 100644
--- a/drivers/staging/lustre/lustre/lov/lov_ea.c
+++ b/drivers/staging/lustre/lustre/lov/lov_ea.c
@@ -150,9 +150,10 @@ static int lsm_unpackmd_common(struct lov_obd *lov,
struct lov_mds_md *lmm,
struct lov_ost_data_v1 *objects)
{
- loff_t stripe_maxbytes = LLONG_MAX;
+ loff_t min_stripe_maxbytes = 0;
unsigned int stripe_count;
struct lov_oinfo *loi;
+ loff_t lov_bytes;
unsigned int i;
/*
@@ -168,8 +169,6 @@ static int lsm_unpackmd_common(struct lov_obd *lov,
stripe_count = lsm_is_released(lsm) ? 0 : lsm->lsm_stripe_count;
for (i = 0; i < stripe_count; i++) {
- loff_t tgt_bytes;
-
loi = lsm->lsm_oinfo[i];
ostid_le_to_cpu(&objects[i].l_ost_oi, &loi->loi_oi);
loi->loi_ost_idx = le32_to_cpu(objects[i].l_ost_idx);
@@ -194,17 +193,21 @@ static int lsm_unpackmd_common(struct lov_obd *lov,
continue;
}
- tgt_bytes = lov_tgt_maxbytes(lov->lov_tgts[loi->loi_ost_idx]);
- stripe_maxbytes = min_t(loff_t, stripe_maxbytes, tgt_bytes);
+ lov_bytes = lov_tgt_maxbytes(lov->lov_tgts[loi->loi_ost_idx]);
+ if (min_stripe_maxbytes == 0 || lov_bytes < min_stripe_maxbytes)
+ min_stripe_maxbytes = lov_bytes;
}
- if (stripe_maxbytes == LLONG_MAX)
- stripe_maxbytes = LUSTRE_EXT3_STRIPE_MAXBYTES;
+ if (min_stripe_maxbytes == 0)
+ min_stripe_maxbytes = LUSTRE_EXT3_STRIPE_MAXBYTES;
+
+ stripe_count = lsm->lsm_stripe_count ?: lov->desc.ld_tgt_count;
+ lov_bytes = min_stripe_maxbytes * stripe_count;
- if (!lsm->lsm_stripe_count)
- lsm->lsm_maxbytes = stripe_maxbytes * lov->desc.ld_tgt_count;
+ if (lov_bytes < min_stripe_maxbytes) /* handle overflow */
+ lsm->lsm_maxbytes = MAX_LFS_FILESIZE;
else
- lsm->lsm_maxbytes = stripe_maxbytes * lsm->lsm_stripe_count;
+ lsm->lsm_maxbytes = lov_bytes;
return 0;
}
--
1.8.3.1
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/20] staging: lustre: batch of fixes to decrease test failures James Simmons <jsimmons@infradead.org> - 2017-07-26 17:30 +0200 [PATCH 17/20] staging: lustre: llite: allow cached acls James Simmons <jsimmons@infradead.org> - 2017-07-26 17:30 +0200 [PATCH 04/20] staging: lustre: lov: fix 'control flow' error in lov_io_init_released James Simmons <jsimmons@infradead.org> - 2017-07-26 17:30 +0200 [PATCH 13/20] staging: lustre: ptlrpc: restore 64-bit time for struct ptlrpc_cli_req James Simmons <jsimmons@infradead.org> - 2017-07-26 17:30 +0200 [PATCH 06/20] staging: lustre: lmv: assume a real connection in lmv_connect() James Simmons <jsimmons@infradead.org> - 2017-07-26 17:30 +0200 [PATCH 07/20] staging: lustre: lov: Ensure correct operation for large object sizes James Simmons <jsimmons@infradead.org> - 2017-07-26 17:30 +0200 [PATCH 11/20] staging: lustre: lustre: fix all less than 0 comparison for unsigned values James Simmons <jsimmons@infradead.org> - 2017-07-26 17:30 +0200 [PATCH 03/20] staging: lustre: ldlm: crash on umount in cleanup_resource James Simmons <jsimmons@infradead.org> - 2017-07-26 17:30 +0200 [PATCH 10/20] staging: lustre: ldlm: restore interval_iterate_reverse function James Simmons <jsimmons@infradead.org> - 2017-07-26 17:30 +0200 [PATCH 14/20] staging: lustre: ptlrpc: don't use CFS_DURATION_T for time64_t James Simmons <jsimmons@infradead.org> - 2017-07-26 17:30 +0200 [PATCH 08/20] staging: lustre: ptlrpc: correct use of list_add_tail() James Simmons <jsimmons@infradead.org> - 2017-07-26 17:30 +0200 [PATCH 01/20] staging: lustre: osc: soft lock - osc_makes_rpc() James Simmons <jsimmons@infradead.org> - 2017-07-26 17:30 +0200 [PATCH 19/20] staging: lustre: llite: add xattr.h header to xattr.c James Simmons <jsimmons@infradead.org> - 2017-07-26 17:30 +0200 [PATCH 16/20] staging: lustre: libcfs: fix test for libcfs_ioctl_hdr minimum size James Simmons <jsimmons@infradead.org> - 2017-07-26 17:30 +0200 [PATCH 05/20] staging: lustre: lov: remove unused code James Simmons <jsimmons@infradead.org> - 2017-07-26 17:30 +0200 [PATCH 20/20] staging: lustre: llite: set security xattr using __vfs_setxattr James Simmons <jsimmons@infradead.org> - 2017-07-26 17:30 +0200 [PATCH 12/20] staging: lustre: linkea: linkEA size limitation James Simmons <jsimmons@infradead.org> - 2017-07-26 17:30 +0200 [PATCH 02/20] staging: lustre: ldlm: restore missing newlines in ldlm sysfs files James Simmons <jsimmons@infradead.org> - 2017-07-26 17:30 +0200 [PATCH 09/20] staging: lustre: ptlrpc: no need to reassign mbits for replay James Simmons <jsimmons@infradead.org> - 2017-07-26 17:30 +0200
csiph-web