Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Oct 3, 2023
1 parent a7ac96f commit c94e11a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4392,9 +4392,10 @@ static MRF_RETURN_TYPE snap_mrf(struct bio *bio){
trace_event_bio(EVENT_BIO_INCOMING_SNAP_MRF, bio, 0);
#endif

//if a write request somehow gets sent in, discard it
//if a write request somehow gets sent in, redirect it to the base device
if(bio_data_dir(bio)){
elastio_snap_bio_endio(bio, -EOPNOTSUPP);
elastio_snap_bio_set_dev(bio, dev->sd_base_dev);
elastio_snap_submit_bio(bio);
MRF_RETURN(0);
}else if(tracer_read_fail_state(dev)){
elastio_snap_bio_endio(bio, wrap_err_io(dev));
Expand Down Expand Up @@ -5101,9 +5102,6 @@ static int __tracer_setup_snap(struct snap_device *dev, unsigned int minor, stru
dev->sd_gd->flags |= GENHD_FL_NO_PART;
#endif

//set the device as read-only
set_disk_ro(dev->sd_gd, 1);

//register gendisk with the kernel
LOG_DEBUG("adding disk");
#ifdef HAVE_ADD_DISK_INT
Expand Down
2 changes: 1 addition & 1 deletion tests/test_multipart.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def test_multipart_modify_origins(self):
os.sync()

# TODO: norecovery option, probably, should not be here after the fix of the elastio/elastio-snap#63
opts = "nouuid,norecovery,ro" if (self.fs == "xfs") else "ro"
opts = "nouuid,ro" if (self.fs == "xfs") else "ro"
util.mount(self.snap_devices[i], self.snap_mounts[i], opts)
self.addCleanup(util.unmount, self.snap_mounts[i])

Expand Down
2 changes: 1 addition & 1 deletion tests/test_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def test_modify_origin(self):
os.sync()

# TODO: norecovery option, probably, should not be here after the fix of the elastio/elastio-snap#63
opts = "nouuid,norecovery,ro" if (self.fs == "xfs") else "ro"
opts = "nouuid,ro" if (self.fs == "xfs") else "ro"
util.mount(self.snap_device, self.snap_mount, opts)
self.addCleanup(util.unmount, self.snap_mount)

Expand Down

0 comments on commit c94e11a

Please sign in to comment.