[Ocfs2-tools-devel] Re: [PATCH 1/2] The io_cache implementation
Joel Becker
Joel.Becker at oracle.com
Tue Mar 27 01:43:51 PDT 2007
On Tue, Mar 27, 2007 at 02:48:45PM +0800, tao.ma wrote:
> >+ ret = io_cache_read_one_block(channel, blkno, data);
> >
> Should data change accordingly? data + i * channel->io_blksize?
> The same error happens in io_cache_write_block.
You know, I could swear I did that. Let me peruse, because I
think you are right.
> >+ memcpy(icb->icb_buf, data, channel->io_blksize);
> >+ io_cache_seen(ic, icb);
> >+
> >+ ret = unix_io_write_block(channel, blkno, 1, icb->icb_buf);
> >+ return ret;
> >+}
> >
> I think the "memcpy" should be moved after the success of
> "unix_io_write_block" so that we can keep consistent of the buffer and
> the real content on the disk.
Hmm, while I liked the idea of "writing out of the cache", you
make a valid point that we want the cache to reflect the disk. On the
other hand, we have no idea what the disk looks like when a write fails
- it could be an EIO that actually modified the platter.
Perhaps just remove the block from the cache on failure to force
a real re-read from disk?
Joel
--
Life's Little Instruction Book #198
"Feed a stranger's expired parking meter."
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127
More information about the Ocfs2-tools-devel
mailing list