Trond Myklebust <[email protected]> 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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
|
|