From: Block Device <blockdevice@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: Block I/O Mystery
Date: Fri, 7 Oct 2005 11:31:43 +0530 [thread overview]
Message-ID: <64c763540510062301v2ac65a47p953038b8b674cf1d@mail.gmail.com> (raw)
Hi,
I am trying to write to inode blocks without using the VFS layer
(filp_open, f_op->write)
etc.
I could use __bread to read the inode blocks correctly. But when I'm
trying to write a block after changing it I face a strange problem.
My changes do not show up when I cat the file but if I use dd command on
the block device it shows my writes.
Steps I performed :
a) Created a file of 8K ( 2blocks ) and filled it with 'a'.
b) Read the blocks using __bread and print(k)ed the contents.
This worked correctly.
c) Called __getblk for a file block, locked the buffer, made
changes to it (memcpy),
marked buffer dirty, unlocked it and called sync_dirty_buffer.
d) If I try to see contents of the file ( cat or vi ) they are
shown unchanged, but if I
use dd on the raw device or use step b) to read a block the
changes made @ c)
are seen.
Also, if I unmount the filesystem and mount it again the changes are
visible through cat, vi etc.
Can someone explain what exactly is going wrong ?
I'm using the 2.6.13 kernel.
Thanks & Regards
-BD
next reply other threads:[~2005-10-07 6:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-07 6:01 Block Device [this message]
2005-10-07 10:04 ` Nikita Danilov
2005-10-07 11:36 ` Block Device
2005-10-07 11:56 ` Nikita Danilov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=64c763540510062301v2ac65a47p953038b8b674cf1d@mail.gmail.com \
--to=blockdevice@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®