From: cyhung.cs00g@nctu.edu.tw Subject: Why when I copy a file, there was no metadata come with the user data in last two transactions...? Date: Tue, 20 Nov 2012 22:11:04 +0800 Message-ID: Mime-Version: 1.0 Content-Type: text/plain;charset=Big5 Content-Transfer-Encoding: 8bit To: linux-fsdevel@vger.kernel.org Return-path: Received: from mailreg.NCTU.edu.tw ([211.76.241.6]:52619 "EHLO mailreg.nctu.edu.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751778Ab2KTO53 (ORCPT ); Tue, 20 Nov 2012 09:57:29 -0500 Received: from webmail.nctu.edu.tw (webmail.nctu.edu.tw [140.113.27.133]) by mailreg.nctu.edu.tw (Postfix) with ESMTP id A8D107E971 for ; Tue, 20 Nov 2012 22:25:46 +0800 (CST) Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi I want to ask a question. First, I describe the scenario I encountered. I generated a 1G txt file, and the file content is "1234567" repeat. And I used "cp" instruction to copy this file to the destination empty folder. (in linux2.6.17, ext3 with ordered mode) I observed that every commit transactions before "prompt", there would have metadata (i.e., journal_head on t_buffer_list) with user data(i.e., journal_head on t_sync_datalist) in each transaction. After the "prompt", there would be about 3 transaction left to finish the "copy" instruction, we can call that T1, T2 and T3. When T1 occurred, there would still has metadata with the user data in this transaction. But the problem is that, after transaction T1, T2&T3 only has the userdata (i.e., only has journal_head on t_sync_datalist), there were no any metadata there !!!! As I known before, the user data was flushed from the page cache into a transaction and then flush to the disk. And it has to have some metadata with it (ex: block allocation info, etc.) But why the last 2 transactions always has no metadata..... (every time, no exception!) 1. I've try to print the user data in the last two transaction, and the result is that the data is what I copied. 2. Another observation is that, in the last two transactions, the number of handles is always equal to the number of journal_head on t_sync_datalist. The above is the question I want to ask. Thank you so much!!!!