Skip to content

Commit

Permalink
os/FuseStore: only flush if dirty
Browse files Browse the repository at this point in the history
No need to rewrite the object unless it was changed.

This partially fixes truncate.

Signed-off-by: Sage Weil <[email protected]>
  • Loading branch information
liewegas committed Sep 7, 2016
1 parent b6870a6 commit 265730a
Show file tree
Hide file tree
Showing 3 changed files with 157 additions and 47 deletions.
4 changes: 4 additions & 0 deletions qa/workunits/objectstore/test_fuse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,13 @@ test ! -s $MNT/meta/all/#-1:7b3f43c4:::osd_superblock:0#/data
echo asdfasdfasdf > $MNT/meta/all/#-1:7b3f43c4:::osd_superblock:0#/data
test -s $MNT/meta/all/#-1:7b3f43c4:::osd_superblock:0#/data
grep -q asdfasdfasdf $MNT/meta/all/#-1:7b3f43c4:::osd_superblock:0#/data
truncate --size 4 $MNT/meta/all/#-1:7b3f43c4:::osd_superblock:0#/data
stat --format=%s $MNT/meta/all/#-1:7b3f43c4:::osd_superblock:0#/data | grep -q ^4$
expect_false grep -q asdfasdfasdf $MNT/meta/all/#-1:7b3f43c4:::osd_superblock:0#/data
rm $MNT/meta/all/#-1:7b3f43c4:::osd_superblock:0#/data
test ! -s $MNT/meta/all/#-1:7b3f43c4:::osd_superblock:0#/data


# create pg collection
mkdir --mode 0003 $MNT/0.0_head
cat $MNT/0.0_head/bitwise_hash_bits
Expand Down
Loading

0 comments on commit 265730a

Please sign in to comment.