lkml.org 
[lkml]   [2005]   [Oct]   [7]   [last100]   RSS Feed
Views: [more markup]   [less markup]   [headers]   [forward]  
 
Messages in this thread
/
DateFri, 7 Oct 2005 11:31:43 +0530
FromBlock Device <>
SubjectBlock I/O Mystery
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-10-07 04:04    [W:0.131 / U:0.590 seconds]
©2003-2008 Jasper Spaans