lkml.org 
[lkml]   [2005]   [Sep]   [2]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateThu, 1 Sep 2005 21:38:53 -0700
FromAndrew Morton <>
SubjectRe: Change in NFS client behavior
Trond Myklebust <trond.myklebust@fys.uio.no> wrote:
>

Looks good from a quick scan.

> +static int do_posix_truncate(struct dentry *dentry, loff_t length)
>  +{
>  +	int err = 0;
>  +	struct iattr newattrs;
>  +
>  +	newattrs.ia_size = length;
>  +	newattrs.ia_valid = ATTR_SIZE;
>  +
>  +	down(&dentry->d_inode->i_sem);
>  +	/* In SuS/Posix lore, truncate to the current file size is a no-op */
>  +	if (length != i_size_read(dentry->d_inode))
>  +		err = notify_change(dentry, &newattrs);
>  +	up(&dentry->d_inode->i_sem);
>  +	return err;
>  +}

I'm not sure that we really need to bother putting the i_size test inside
i_sem.  If somebody is changing the file size in parallel with truncate
then they'll get unpredictable results anyway.  Needs deep thought.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-09-02 04:45    [from the cache]
©2003-2008