Commit b91a7bdc authored by Ilya Dryomov's avatar Ilya Dryomov

rbd: don't assert on writes to snapshots

The check added in commit 721c7fc7 ("block: fail op_is_write()
requests to read-only partitions") was lifted in commit a32e236e
("Partially revert "block: fail op_is_write() requests to read-only
partitions"").  Basic things like user triggered writes and discards
are still caught, but internal kernel users can submit anything.  In
particular, ext4 will attempt to write to the superblock if it detects
errors in the filesystem, even if the filesystem is mounted read-only
on a read-only partition.

The assert is overkill regardless.
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent a32e4143
......@@ -3842,8 +3842,12 @@ static void rbd_queue_workfn(struct work_struct *work)
goto err_rq;
}
rbd_assert(op_type == OBJ_OP_READ ||
rbd_dev->spec->snap_id == CEPH_NOSNAP);
if (op_type != OBJ_OP_READ && rbd_dev->spec->snap_id != CEPH_NOSNAP) {
rbd_warn(rbd_dev, "%s on read-only snapshot",
obj_op_name(op_type));
result = -EIO;
goto err;
}
/*
* Quit early if the mapped snapshot no longer exists. It's
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment