mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-17 02:31:27 +00:00
Note from Alexander Lyakas <alex.bolshoy@gmail.com> about errors caching by FILEIO handler
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4176 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
39
scst/README
39
scst/README
@@ -1471,6 +1471,45 @@ Note, on some real-life workloads write through caching might perform
|
||||
better, than write back one with the barrier protection turned on.
|
||||
|
||||
|
||||
Errors caching
|
||||
..............
|
||||
|
||||
When using virtual device in FILEIO mode, the Linux page cache comes
|
||||
into picture. The negative side of it is that it's sometimes also
|
||||
caching errored pages. That is, if the underlying file experiences IO
|
||||
errors, those errors might be cached by the Linux page cache. As a
|
||||
result, even when the underlying file recovers and stops failing IOs,
|
||||
the initiator may still hit IO errors returned by the Linux page cache,
|
||||
until the cache re-reads the errored pages (usually it happens pretty
|
||||
soon, but not immediately). To make sure that cached pages are dropped,
|
||||
one of the following can be done:
|
||||
|
||||
- Detach the SCSI virtual device (del_device) and re-attach it
|
||||
(add_device). This should evict all the cached pages, unless somebody
|
||||
else holds the same "filename" opened.
|
||||
|
||||
- Issue a BLKFLSBUF ioctl to the same "filename" you provided for "add_device".
|
||||
|
||||
For the second option, a rudimentary C code is required:
|
||||
|
||||
fd = open(filename, O_RDWR);
|
||||
if (fd < 0) {
|
||||
err = errno;
|
||||
...
|
||||
}
|
||||
else {
|
||||
err = ioctl(fd, BLKFLSBUF);
|
||||
if (err < 0) {
|
||||
err = errno;
|
||||
...
|
||||
}
|
||||
close(fd);
|
||||
}
|
||||
|
||||
Patch to implement a sysfs entry for the FILEIO handler to accomplish
|
||||
the above is welcome.
|
||||
|
||||
|
||||
BLOCKIO VDISK mode
|
||||
------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user