mbox series

[v2,0/2] exfat: get file size from DataLength

Message ID PUZPR04MB6316F533D28ACDEBDC20BD3C8124A@PUZPR04MB6316.apcprd04.prod.outlook.com (mailing list archive)
Headers show
Series exfat: get file size from DataLength | expand

Message

Yuezhang.Mo@sony.com June 28, 2023, 1:52 a.m. UTC
From the exFAT specification, the file size should get from 'DataLength'
of Stream Extension Directory Entry, not 'ValidDataLength'.

Without this patch set, 'DataLength' is always same with 'ValidDataLength'
and get file size from 'ValidDataLength'. If the file is created by other
exFAT implementation and 'DataLength' is different from 'ValidDataLength',
this exFAT implementation will not be compatible.

Changes for v2:
  - Fix race when checking i_size on direct i/o read

Yuezhang Mo (2):
  exfat: change to get file size from DataLength
  exfat: do not zeroed the extended part

 fs/exfat/exfat_fs.h |   2 +
 fs/exfat/file.c     | 210 +++++++++++++++++++++++++++++++++++++++++++-
 fs/exfat/inode.c    |  92 ++++++++++++++++---
 fs/exfat/namei.c    |   7 +-
 4 files changed, 293 insertions(+), 18 deletions(-)