xfs
[Top] [All Lists]

Re: [PATCH] xfstests: add a new test case to test i_size updated properl

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH] xfstests: add a new test case to test i_size updated properly under dio
From: Zheng Liu <gnehzuil.liu@xxxxxxxxx>
Date: Thu, 28 Nov 2013 10:23:53 +0800
Cc: xfs@xxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, Christoph Hellwig <hch@xxxxxxxxxxxxx>, Rich Johnston <rjohnston@xxxxxxx>, Zheng Liu <wenqing.lz@xxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=2820f8IOAa8x5cjmV1L2N3tPUEH5m5A2fD9AN5kmFnI=; b=sjpf82/+M7IvaK61c2xKxDQEphUv1DyZPLK/A663QgweOovEezIBTgr15b1noLPvSq Z3Ksk3kLDfxvhcI2yALFzJoOIkqRXZbhm3R9eO2tBUp7kTLtadgvBqwCIoUG7BmlFeK9 72BqNF35xMTJ0g37Sveb72zJTCGsumRwDkazkFS/+EoVTrtZRcK1hJtWGSKdntTxkYTL Q6ErJvUkmg+cK8fVDx6Zp1ZM0E2+GBsqHCH+Kl3ESs0MBejxABanfmq3B013mPQT0UV/ MCK/bJYnUu911hY+QvqBluWTWwDBeZC4rQH/zXCbr2VcScPYTMFbVnqfNvqceHmygcTT HdOw==
In-reply-to: <20131128003416.GL10988@dastard>
Mail-followup-to: Dave Chinner <david@xxxxxxxxxxxxx>, xfs@xxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, Christoph Hellwig <hch@xxxxxxxxxxxxx>, Rich Johnston <rjohnston@xxxxxxx>, Zheng Liu <wenqing.lz@xxxxxxxxxx>
References: <1385013394-20379-1-git-send-email-wenqing.lz@xxxxxxxxxx> <20131128003416.GL10988@dastard>
User-agent: Mutt/1.5.21 (2010-09-15)
On Thu, Nov 28, 2013 at 11:34:16AM +1100, Dave Chinner wrote:
> On Thu, Nov 21, 2013 at 01:56:34PM +0800, Zheng Liu wrote:
> > From: Zheng Liu <wenqing.lz@xxxxxxxxxx>
> > 
> > In this commit a new test case is added to test that i_size is updated
> > properly under dio reads/writes.  We add a program in /src dir, which
> > has a writer to issue some append dio writes.  Meanwhile it has a
> > reader in this test do some dio reads.  As we expect, reader should read
> > nothing or data with 'a'.  But it might read some data with '0'.
> > 
> > This program is used to simulate binary log operations of database
> > application.  In these applications it implements an master/slave
> > synchronziation for database.
> > 
> > Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx>
> > Cc: Rich Johnston <rjohnston@xxxxxxx>
> > Signed-off-by: Zheng Liu <wenqing.lz@xxxxxxxxxx>
> > ---
> >  src/Makefile          |    2 +-
> >  src/diotest.c         |  166 
> > +++++++++++++++++++++++++++++++++++++++++++++++++
> >  tests/generic/321     |   56 +++++++++++++++++
> >  tests/generic/321.out |    1 +
> >  tests/generic/group   |    1 +
> >  5 files changed, 225 insertions(+), 1 deletion(-)
> >  create mode 100644 src/diotest.c
> >  create mode 100755 tests/generic/321
> >  create mode 100644 tests/generic/321.out
> > 
> > diff --git a/src/Makefile b/src/Makefile
> > index 84c8297..8c4f592 100644
> > --- a/src/Makefile
> > +++ b/src/Makefile
> > @@ -18,7 +18,7 @@ LINUX_TARGETS = xfsctl bstat t_mtab getdevicesize 
> > preallo_rw_pattern_reader \
> >     locktest unwritten_mmap bulkstat_unlink_test t_stripealign \
> >     bulkstat_unlink_test_modified t_dir_offset t_futimens t_immutable \
> >     stale_handle pwrite_mmap_blocked t_dir_offset2 seek_sanity_test \
> > -   seek_copy_test t_readdir_1 t_readdir_2 fsync-tester nsexec
> > +   seek_copy_test t_readdir_1 t_readdir_2 fsync-tester nsexec diotest
> 
> Fails to compile:
> 
> /tmp/cc54N2JC.o: In function `main':
> /home/dave/src/xfstests-dev/src/diotest.c:120: undefined reference to 
> `pthread_create'
> /home/dave/src/xfstests-dev/src/diotest.c:135: undefined reference to 
> `pthread_join'
> 
> It needs to be linked against libpthread, I think, so that needs to
> be added to the LLDLIBS line, and the appropriate autoconf detection
> macros added. You shoul dbe able to just copy the some
> detection/infrastructure macros across from xfsprogs...

Oops, thanks for the review.  I will fix it later and send a newer one.

                                                - Zheng

<Prev in Thread] Current Thread [Next in Thread>