Bug 201973 - File Size
Summary: File Size
Status: RESOLVED INVALID
Alias: None
Product: File System
Classification: Unclassified
Component: XFS (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: FileSystem/XFS Default Virtual Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-12 09:28 UTC by ghasem keshavarz
Modified: 2018-12-12 15:31 UTC (History)
1 user (show)

See Also:
Kernel Version: 3.10.0-862.el7.x86_64
Subsystem:
Regression: No
Bisected commit-id:


Attachments
file size (28.31 KB, image/jpeg)
2018-12-12 09:28 UTC, ghasem keshavarz
Details

Description ghasem keshavarz 2018-12-12 09:28:47 UTC
Created attachment 279965 [details]
file size

hi
when my log file is used by program and i truncate it, file size is release on disk but ll/ls command show old size of file, but du command work correctly

good luck
Comment 1 Eric Sandeen 2018-12-12 15:31:59 UTC
Hi, this is the upstream kernel bug tracker, and 3.10.0-862.el7.x86_64 is not an upstream kernel.  This is not the appropriate bug tracker for distribution kernels.

Also, you've not provided any reproducer steps, just a screenshot of du & ls which shows no problem.

There is no expectation that du should match ls.  One reflects the maximum offset in a file, the other reflects the amount of space allocated to the file.  They are two different quantities.  Observe:

# fallocate -l 161m output.out
# truncate --size 18g output.out

# du -h output.out
161M	output.out

# ls -lh output.out
-rw-r--r--. 1 root root 18G Dec 12 10:30 output.out

Note You need to log in before you can comment on or make changes to this bug.