lkml.org 
[lkml]   [2020]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC PATCH V2 10/12] fs/xfs: Fix truncate up
    On Fri, Jan 10, 2020 at 11:29:40AM -0800, ira.weiny@intel.com wrote:
    > From: Ira Weiny <ira.weiny@intel.com>
    >
    > When zeroing the end of a file we must account for bytes contained in
    > the final page which are past EOF.
    >
    > Extend the range passed to iomap_zero_range() to reach LLONG_MAX which
    > will include all bytes of the final page.
    >
    > Signed-off-by: Ira Weiny <ira.weiny@intel.com>
    > ---
    > fs/xfs/xfs_iops.c | 2 +-
    > 1 file changed, 1 insertion(+), 1 deletion(-)
    >
    > diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
    > index a2f2604c3187..a34b04e8ac9c 100644
    > --- a/fs/xfs/xfs_iops.c
    > +++ b/fs/xfs/xfs_iops.c
    > @@ -910,7 +910,7 @@ xfs_setattr_size(
    > */
    > if (newsize > oldsize) {
    > trace_xfs_zero_eof(ip, oldsize, newsize - oldsize);
    > - error = iomap_zero_range(inode, oldsize, newsize - oldsize,
    > + error = iomap_zero_range(inode, oldsize, LLONG_MAX - oldsize,

    Huh? Won't this cause the file size to be set to LLONG_MAX?

    --D

    > &did_zeroing, &xfs_buffered_write_iomap_ops);
    > } else {
    > error = iomap_truncate_page(inode, newsize, &did_zeroing,
    > --
    > 2.21.0
    >

    \
     
     \ /
      Last update: 2020-01-13 23:30    [W:4.220 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site