From fafbce723cfafa731066c049ebcb4af35bf0ae58 Mon Sep 17 00:00:00 2001 From: Oleg Drokin Date: Tue, 30 Sep 2014 21:09:05 -0400 Subject: [PATCH] Revert "LU-5654 osd-ldiskfs: Handle holes in osd_ldiskfs_read()" Adds problems dcocumented in LU-5684 This reverts commit b5485d307568af92e1a940fa4a7859e6db5b7a97. --- lustre/osd-ldiskfs/osd_io.c | 22 ++++++++-------------- lustre/tests/conf-sanity.sh | 15 +++++---------- 2 files changed, 13 insertions(+), 24 deletions(-) diff --git a/lustre/osd-ldiskfs/osd_io.c b/lustre/osd-ldiskfs/osd_io.c index 8344d4a..9765595 100644 --- a/lustre/osd-ldiskfs/osd_io.c +++ b/lustre/osd-ldiskfs/osd_io.c @@ -1355,21 +1355,15 @@ int osd_ldiskfs_read(struct inode *inode, void *buf, int size, loff_t *offs) boffs = *offs & (blocksize - 1); csize = min(blocksize - boffs, size); bh = ldiskfs_bread(NULL, inode, block, 0, &err); - if (err != 0) { - CERROR("%s: can't read %u@%llu on ino %lu: rc = %d\n", - LDISKFS_SB(inode->i_sb)->s_es->s_volume_name, - csize, *offs, inode->i_ino, err); - if (bh != NULL) - brelse(bh); - return err; - } + if (!bh) { + CERROR("%s: can't read %u@%llu on ino %lu: rc = %d\n", + LDISKFS_SB(inode->i_sb)->s_es->s_volume_name, + csize, *offs, inode->i_ino, err); + return err; + } - if (bh != NULL) { - memcpy(buf, bh->b_data + boffs, csize); - brelse(bh); - } else { - memset(buf, 0, csize); - } + memcpy(buf, bh->b_data + boffs, csize); + brelse(bh); *offs += csize; buf += csize; diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index b050725..edaf102 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -3669,7 +3669,6 @@ run_test 55 "check lov_objid size" test_56() { local mds_journal_size_orig=$MDSJOURNALSIZE - local n MDSJOURNALSIZE=16 @@ -3677,26 +3676,22 @@ test_56() { add mds${num} $(mkfs_opts mds${num} $(mdsdevname $num)) \ --reformat $(mdsdevname $num) $(mdsvdevname $num) done - add ost1 $(mkfs_opts ost1 $(ostdevname 1)) --index=10000 --reformat \ + add ost1 $(mkfs_opts ost1 $(ostdevname 1)) --index=1000 --reformat \ $(ostdevname 1) $(ostvdevname 1) - add ost2 $(mkfs_opts ost2 $(ostdevname 2)) --index=1000 --reformat \ + add ost2 $(mkfs_opts ost2 $(ostdevname 2)) --index=10000 --reformat \ $(ostdevname 2) $(ostvdevname 2) start_mgsmds - start_ost || error "Unable to start first ost (idx 10000)" - start_ost2 || error "Unable to start second ost (idx 1000)" + start_ost + start_ost2 || error "Unable to start second ost" mount_client $MOUNT || error "Unable to mount client" echo ok $LFS osts - $LFS setstripe --stripe-count=-1 $DIR/$tfile || error "Unable to create" - n=$($LFS getstripe --stripe-count $DIR/$tfile) - [ "$n" -eq 2 ] || error "Stripe count not two: $n" - rm $DIR/$tfile stopall MDSJOURNALSIZE=$mds_journal_size_orig reformat } -run_test 56 "check big OST indexes and out-of-index-order start" +run_test 56 "check big indexes" test_57a() { # bug 22656 local NID=$(do_facet ost1 "$LCTL get_param nis" | tail -1 | awk '{print $1}') -- 1.8.3.1