From patchwork Sat Jan 30 10:55:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 44059 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id BED65B7D19 for ; Sat, 30 Jan 2010 21:55:07 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751147Ab0A3KzF (ORCPT ); Sat, 30 Jan 2010 05:55:05 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751355Ab0A3KzF (ORCPT ); Sat, 30 Jan 2010 05:55:05 -0500 Received: from bombadil.infradead.org ([18.85.46.34]:51322 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751147Ab0A3KzC (ORCPT ); Sat, 30 Jan 2010 05:55:02 -0500 Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1NbAyj-00060e-NY; Sat, 30 Jan 2010 10:55:01 +0000 Date: Sat, 30 Jan 2010 05:55:01 -0500 From: Christoph Hellwig To: Eric Sandeen Cc: ext4 development , xfs-oss , Giel de Nijs Subject: Re: [PATCH] xfstests 224: test aio hole-fill at 4g Message-ID: <20100130105501.GA22909@infradead.org> References: <4B633F9A.8000404@sandeen.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4B633F9A.8000404@sandeen.net> User-Agent: Mutt/1.5.19 (2009-01-05) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, Jan 29, 2010 at 02:05:46PM -0600, Eric Sandeen wrote: > Testcase from Giel de Nijs > on linux-ext4 list, ""Possible ext4 data corruption > with large files and async I/O," on 29 Jan 2010 > > ext4 put byte offsets in a block offset u32 container > in the endio struct, so 4g wrapped to 0 leading to > data corruption when the unwritten extent did not > get converted. There's various type messups in the test program that make it fail for me on a 32-bit machine. The patch below fixes it up, but it seems like we should rather add a variant of that code as aio_read/write commands to xfs_io instead of adding a new test program. --- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: xfstests-dev/src/aio-write.c =================================================================== --- xfstests-dev.orig/src/aio-write.c 2010-01-30 10:42:24.000000000 +0000 +++ xfstests-dev/src/aio-write.c 2010-01-30 10:45:30.000000000 +0000 @@ -42,7 +42,7 @@ void usage(void) /* * Scale value by kilo, mega, or giga. */ -loff_t scale_by_kmg(long long value, char scale) +long long scale_by_kmg(long long value, char scale) { switch (scale) { case 'g': @@ -69,7 +69,7 @@ switch (scale) { int main(int argc, char ** argv) { char filename[PATH_MAX]; - loff_t offset = 0; + long long offset = 0; size_t length = 0; int seed = 0xFF; int queue_depth = 8; @@ -95,12 +95,12 @@ int main(int argc, char ** argv) seed = (int)strtol(optarg, &endp, 0); break; case 'o': - offset = strtol(optarg, &endp, 0); - offset = scale_by_kmg((long long)offset, *endp); + offset = strtoll(optarg, &endp, 0); + offset = scale_by_kmg(offset, *endp); break; case 'l': length = strtol(optarg, &endp, 0); - length = scale_by_kmg((long long)length, *endp); + length = scale_by_kmg(length, *endp); break; case 'v': verbose++; @@ -141,7 +141,8 @@ int main(int argc, char ** argv) io_prep_pwrite(&iocb, fd, buf, length, offset); iocblist[0] = &iocb; if (verbose) - printf("submitting write of %zd bytes at offset %zd\n", length, offset); + printf("submitting write of %zd bytes at offset %lld\n", + length, offset); err = io_submit(io_ctx, 1, iocblist); if (err < 0) { printf("error submitting I/O requests: %s\n", strerror(-err));