Whamcloud - gitweb
Revert "LU-5654 osd-ldiskfs: Handle holes in osd_ldiskfs_read()"
authorOleg Drokin <oleg.drokin@intel.com>
Wed, 1 Oct 2014 01:09:05 +0000 (21:09 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 1 Oct 2014 01:09:05 +0000 (21:09 -0400)
Adds problems dcocumented in LU-5684

This reverts commit b5485d307568af92e1a940fa4a7859e6db5b7a97.

lustre/osd-ldiskfs/osd_io.c
lustre/tests/conf-sanity.sh

index 8344d4a..9765595 100644 (file)
@@ -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;
index b050725..edaf102 100644 (file)
@@ -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}')