From: Steve Lord <lord@xfs.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Miquel van Smoorenburg <miquels@cistron.nl>,
Andrew Morton <akpm@osdl.org>, Nathan Scott <nathans@sgi.com>,
linux-kernel@vger.kernel.org, linux-xfs@oss.sgi.com
Subject: Re: 2.6.2-rc2 nfsd+xfs spins in i_size_read()
Date: Tue, 03 Feb 2004 08:13:04 -0600 [thread overview]
Message-ID: <401FAC70.8070104@xfs.org> (raw)
In-Reply-To: <20040204000315.A12127@infradead.org>
Christoph Hellwig wrote:
> Okay, what about this little patch?:
>
>
> Index: fs/xfs/linux-2.6/xfs_iops.c
> ===================================================================
> RCS file: /cvs/linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c,v
> retrieving revision 1.212
> diff -u -p -r1.212 xfs_iops.c
> --- fs/xfs/linux-2.6/xfs_iops.c 12 Dec 2003 04:17:52 -0000 1.212
> +++ fs/xfs/linux-2.6/xfs_iops.c 3 Feb 2004 23:56:17 -0000
> @@ -80,11 +80,15 @@ validate_fields(
> vattr_t va;
> int error;
>
> - va.va_mask = XFS_AT_NLINK|XFS_AT_SIZE|XFS_AT_NBLOCKS;
> + va.va_mask = XFS_AT_NLINK|XFS_AT_SIZE|XFS_AT_NBLOCKS|XFS_AT_SIZE;
> VOP_GETATTR(vp, &va, ATTR_LAZY, NULL, error);
> ip->i_nlink = va.va_nlink;
> ip->i_size = va.va_size;
> ip->i_blocks = va.va_nblocks;
> +
> + /* we're under i_sem so i_size can't change under us */
> + if (i_size_read(ip) != va.va_size)
> + i_size_write(ip, va.va_size);
> }
>
> /*
> @@ -186,8 +190,7 @@ linvfs_mknod(
>
> if (S_ISCHR(mode) || S_ISBLK(mode))
> ip->i_rdev = rdev;
> - else if (S_ISDIR(mode))
> - validate_fields(ip);
> + validate_fields(ip);
There was some reason this was only necessary on directories, but I
cannot remember why just now.
> d_instantiate(dentry, ip);
> validate_fields(dir);
> }
> @@ -536,6 +539,7 @@ linvfs_setattr(
> if (error)
> return(-error); /* Positive error up from XFS */
> if (ia_valid & ATTR_SIZE) {
> + i_size_write(inode, vattr.va_size);
> error = vmtruncate(inode, attr->ia_size);
> }
>
> Index: fs/xfs/linux-2.6/xfs_vnode.c
> ===================================================================
> RCS file: /cvs/linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.c,v
> retrieving revision 1.120
> diff -u -p -r1.120 xfs_vnode.c
> --- fs/xfs/linux-2.6/xfs_vnode.c 20 Oct 2003 02:08:58 -0000 1.120
> +++ fs/xfs/linux-2.6/xfs_vnode.c 3 Feb 2004 23:56:17 -0000
> @@ -213,7 +213,6 @@ vn_revalidate(
> inode->i_mtime = va.va_mtime;
> inode->i_ctime = va.va_ctime;
> inode->i_atime = va.va_atime;
> - i_size_write(inode, va.va_size);
> if (va.va_xflags & XFS_XFLAG_IMMUTABLE)
> inode->i_flags |= S_IMMUTABLE;
> else
>
I think this should work, it just leaves the extending O_DIRECT write
case. Keeping the revalidate call out of the path for creating regular
files would be nice though, why did you deem that necessary?
Steve
next prev parent reply other threads:[~2004-02-04 15:08 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-28 17:17 2.6.2-rc2 nfsd+xfs spins in i_size_read() Miquel van Smoorenburg
2004-01-29 6:25 ` Andrew Morton
2004-01-29 23:20 ` Miquel van Smoorenburg
2004-02-04 0:03 ` Christoph Hellwig
2004-02-03 14:13 ` Steve Lord [this message]
2004-02-04 15:16 ` Christoph Hellwig
2004-02-04 18:17 ` Christoph Hellwig
2004-02-04 0:06 ` David Weinehall
2004-02-04 0:07 ` Christoph Hellwig
2004-01-30 16:01 ` Miquel van Smoorenburg
2004-01-30 20:21 ` Miquel van Smoorenburg
2004-01-30 22:13 ` Miquel van Smoorenburg
2004-01-30 22:34 ` Andrew Morton
2004-01-30 22:53 ` Christoph Hellwig
2004-01-30 23:13 ` Andrew Morton
2004-01-31 1:25 ` Miquel van Smoorenburg
2004-01-31 1:38 ` Andrew Morton
2004-01-31 11:46 ` Miquel van Smoorenburg
2004-01-31 15:59 ` Steve Lord
2004-02-01 16:15 ` Christoph Hellwig
2004-01-31 16:41 ` Steve Lord
2004-01-31 17:07 ` Christoph Hellwig
2004-02-01 1:46 ` Anton Blanchard
2004-01-30 23:07 ` Nathan Scott
2004-01-29 6:30 ` Nathan Scott
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=401FAC70.8070104@xfs.org \
--to=lord@xfs.org \
--cc=akpm@osdl.org \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@oss.sgi.com \
--cc=miquels@cistron.nl \
--cc=nathans@sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox