In osd layer, instead of looking if we go beyong isize, just make sure
we send complete pages all the time.
Data in page beyond isize will be discared by client anyway, and it
should not be harmful to send at max PAGE_SIZE-1 more bytes for reads
at end of file.
With this new paradigm, we need to remove sanity test_246, as its sole
purpose is to actually make sure we do not send more than isize bytes
to the client.
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I03dc6037a8dfa1d40d40a4b1f675e047d862d933
Reviewed-on: https://review.whamcloud.com/36238
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Patrick Farrell <farr0186@gmail.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Li Xi <lixi@ddn.com>
#define OBD_FAIL_OST_STATFS_EINPROGRESS 0x231
#define OBD_FAIL_OST_SET_INFO_NET 0x232
#define OBD_FAIL_OST_NODESTROY 0x233
#define OBD_FAIL_OST_STATFS_EINPROGRESS 0x231
#define OBD_FAIL_OST_SET_INFO_NET 0x232
#define OBD_FAIL_OST_NODESTROY 0x233
-#define OBD_FAIL_OST_READ_SIZE 0x234
+/* OBD_FAIL_OST_READ_SIZE 0x234 obsolete since 2.14 */
#define OBD_FAIL_OST_LADVISE_NET 0x235
#define OBD_FAIL_OST_PAUSE_PUNCH 0x236
#define OBD_FAIL_OST_LADVISE_PAUSE 0x237
#define OBD_FAIL_OST_LADVISE_NET 0x235
#define OBD_FAIL_OST_PAUSE_PUNCH 0x236
#define OBD_FAIL_OST_LADVISE_PAUSE 0x237
* lnb->lnb_rc == 0, so it's easy to detect later. */
break;
* lnb->lnb_rc == 0, so it's easy to detect later. */
break;
- if (isize < lnb[i].lnb_file_offset + lnb[i].lnb_len)
- lnb[i].lnb_rc = isize - lnb[i].lnb_file_offset;
- else
- lnb[i].lnb_rc = lnb[i].lnb_len;
+ /* instead of looking if we go beyong isize, send complete
+ * pages all the time
+ */
+ lnb[i].lnb_rc = lnb[i].lnb_len;
/* Bypass disk read if fail_loc is set properly */
if (OBD_FAIL_CHECK(OBD_FAIL_OST_FAKE_RW))
/* Bypass disk read if fail_loc is set properly */
if (OBD_FAIL_CHECK(OBD_FAIL_OST_FAKE_RW))
lnb[i].lnb_rc = lnb[i].lnb_len;
if (lnb[i].lnb_file_offset + lnb[i].lnb_len >= eof) {
lnb[i].lnb_rc = lnb[i].lnb_len;
if (lnb[i].lnb_file_offset + lnb[i].lnb_len >= eof) {
+ /* send complete pages all the time */
if (eof <= lnb[i].lnb_file_offset)
lnb[i].lnb_rc = 0;
if (eof <= lnb[i].lnb_file_offset)
lnb[i].lnb_rc = 0;
- else
- lnb[i].lnb_rc = eof - lnb[i].lnb_file_offset;
/* all subsequent rc should be 0 */
while (++i < npages)
/* all subsequent rc should be 0 */
while (++i < npages)
- if (OBD_FAIL_CHECK(OBD_FAIL_OST_READ_SIZE) &&
- nob != cfs_fail_val)
- rc = -E2BIG;
if (body->oa.o_valid & OBD_MD_FLCKSUM) {
u32 flag = body->oa.o_valid & OBD_MD_FLFLAGS ?
if (body->oa.o_valid & OBD_MD_FLCKSUM) {
u32 flag = body->oa.o_valid & OBD_MD_FLFLAGS ?
}
run_test 245 "check mdc connection flag/data: multiple modify RPCs"
}
run_test 245 "check mdc connection flag/data: multiple modify RPCs"
-test_246() { # LU-7371
- remote_ost_nodsh && skip "remote OST with nodsh"
- [ $OST1_VERSION -lt $(version_code 2.7.62) ] &&
- skip "Need OST version >= 2.7.62"
-
- do_facet ost1 $LCTL set_param fail_val=4095
-#define OBD_FAIL_OST_READ_SIZE 0x234
- do_facet ost1 $LCTL set_param fail_loc=0x234
- $LFS setstripe $DIR/$tfile -i 0 -c 1
- dd if=/dev/zero of=$DIR/$tfile bs=4095 count=1 > /dev/null 2>&1
- cancel_lru_locks $FSNAME-OST0000
- dd if=$DIR/$tfile of=/dev/null bs=1048576 || error "Read failed"
-}
-run_test 246 "Read file of size 4095 should return right length"
-
cleanup_247() {
local submount=$1
cleanup_247() {
local submount=$1