From: Akira Fujita Subject: Re: [RFC][PATCH 2/3] ext4 online defrag (ver 0.7) Date: Wed, 19 Mar 2008 10:05:33 +0900 Message-ID: <200803190105.AA00337@TNESG9526.rs.jp.nec.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="--------------------0831004857779933" Cc: tytso@mit.edu, cmm@us.ibm.com, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org To: Solofo.Ramangalahy@bull.net Return-path: Received: from TYO200.gate.nec.co.jp ([210.143.35.50]:35880 "EHLO tyo200.gate.nec.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754982AbYCSU4F (ORCPT ); Wed, 19 Mar 2008 16:56:05 -0400 Sender: linux-ext4-owner@vger.kernel.org List-ID: This is multipart message. ----------------------0831004857779933 Content-Type: text/plain; charset=us-ascii Hello Solofo, > Hello, > > Akira Fujita writes: > > - printk(KERN_ERR "defrag: failed ext4_ext_defrag\n"); > > - goto ERR; > > + printk(KERN_ERR "ext4 defrag: " > > + "Moving victim file failed. ino [%lu]\n", > > + ext_info->ino); > > This triggers this warning: > fs/ext4/defrag.c: In function 'ext4_defrag_move_victim': > fs/ext4/defrag.c:458: warning: format '%lu' expects type 'long unsigned int', but argument 2 has type 'long long unsigned int' > > (ext4-online-defrag-free-space-fragmentation.patch from ext4-patch-queue 36c86f09d6ac97c2797a1a94d76e2fc1dc3b03f8) > Thank you for notification. And sorry for the delay fix, it has already been pointed out by Mingming. Mingming, could you replace attached file with ext4 patch queue's ? Regards Akira, Signed-off-by: Akira Fujita --- defrag.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- linux-2.6.25-rc5-ext4-org/fs/ext4/defrag.c 2008-03-19 07:16:40.000000000 +0900 +++ linux-2.6.25-rc5-full/fs/ext4/defrag.c 2008-03-19 08:31:01.000000000 +0900 @@ -454,7 +454,7 @@ static int ext4_defrag_move_victim(struc ext_info->ext[i].len, goal, DEFRAG_FORCE_VICTIM, &ext); if (ret < 0) { printk(KERN_ERR "ext4 defrag: " - "Moving victim file failed. ino [%lu]\n", + "Moving victim file failed. ino [%llu]\n", ext_info->ino); goto err; } ----------------------0831004857779933 Content-Type: application/octet-stream; name="ext4-online-defrag-free-space-fragmentation.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="ext4-online-defrag-free-space-fragmentation.patch" ZGlmZiAtTnJ1cCAtWCBsaW51eC0yLjYuMjUtcmM1L0RvY3VtZW50YXRpb24vZG9udGRpZmYg bGludXgtMi42LjI1LXJjNS9mcy9leHQ0L2JhbGxvYy5jIGxpbnV4LTIuNi4yNS1yYzUtZnVs bC9mcy9leHQ0L2JhbGxvYy5jCi0tLSBsaW51eC0yLjYuMjUtcmM1L2ZzL2V4dDQvYmFsbG9j LmMJMjAwOC0wMy0xOSAwNzoyODozMy4wMDAwMDAwMDAgKzA5MDAKKysrIGxpbnV4LTIuNi4y NS1yYzUtZnVsbC9mcy9leHQ0L2JhbGxvYy5jCTIwMDgtMDMtMTkgMDc6MTg6MTkuMDAwMDAw MDAwICswOTAwCkBAIC0zODMsNyArMzgzLDcgQEAgcmVzdGFydDoKICAqIElmIHRoZSBnb2Fs IGJsb2NrIGlzIHdpdGhpbiB0aGUgcmVzZXJ2YXRpb24gd2luZG93LCByZXR1cm4gMTsKICAq IG90aGVyd2lzZSwgcmV0dXJuIDA7CiAgKi8KLXN0YXRpYyBpbnQKK2ludAogZ29hbF9pbl9t eV9yZXNlcnZhdGlvbihzdHJ1Y3QgZXh0NF9yZXNlcnZlX3dpbmRvdyAqcnN2LCBleHQ0X2dy cGJsa190IGdycF9nb2FsLAogCQkJZXh0NF9ncm91cF90IGdyb3VwLCBzdHJ1Y3Qgc3VwZXJf YmxvY2sgKnNiKQogewpAQCAtNDg4LDcgKzQ4OCw3IEBAIHZvaWQgZXh0NF9yc3Zfd2luZG93 X2FkZChzdHJ1Y3Qgc3VwZXJfYmwKICAqIGZyb20gdGhlIGZpbGVzeXN0ZW0gcmVzZXJ2YXRp b24g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