Hi again, I've tried to sync the file system but that does not seem to
help. I still get 0 byte files after a sync and a hard reboot.
I looked at the kernel source and found that jfs_sync_fs calls
jfs_flush_journal with wait <= 1 and jfs_syncpt with parameter hard_sync
set to 0. However, according to the comments to lmLogSync in jfs_logmgr.c
hard_sync = 1 means: "push dirty metapages out to disk".
As far as I can see this only happens when the log is closed via
lmLogShutdown which calls jfs_flush_journal(log, 2); This happens when
unmounting a rw file system, but it doesn't seem to happen for an ordinary
sync.
jfs_syncpt is also called with hard_sync = 1 from txEnd in jfs_txnmgr.c
under certain circumstances which I have not investigated yet, but I have
not found any connection to sync.
Plus, in jfs_umount_rw in jfs_umount.c the following is also done:
/*
* Make sure all metadata makes it to disk
*/
dbSync(sbi->ipbmap);
diSync(sbi->ipimap);
I'm not entirely sure what dbSync and diSync do or what the
filemap_fdatawrite(sbi->ipbmap->imapping) etc for a hard_sync=1 does. But
isn't that required to properly write everything to disk, which one would
want when doing a sync?
Perhaps a call to jfs_syncpt(log,1) in jfs_sync_fs could improve my
situation?
Regards
Mikael
2012/7/17 Mikael Liljeroth <[email protected]>
> Thanks for all the tips and pointers, much appreciated. I have a lot to
> learn, but I will try the fsync approach in the meantime.
>
> Regards
> Mikael
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Jfs-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jfs-discussion