Project

General

Profile

Actions

Tasks #64164

open

Tasks #63293: Implement fscrypt in libcephfs and cephfs-fuse

verify st_blocks is correct

Added by Christopher Hoffman 3 months ago. Updated about 12 hours ago.

Status:
In Progress
Priority:
Normal
Category:
-
Target version:
-
% Done:

0%

Tags:
Reviewed:
Affected Versions:
Component(FS):
Labels (FS):
Pull request ID:

Actions #1

Updated by Patrick Donnelly 3 months ago

  • Assignee set to Christopher Hoffman
Actions #2

Updated by Christopher Hoffman about 12 hours ago

  • Status changed from New to In Progress

It appears logic the #warning is addressing matches non-fscrypt directories behavior. This logic has been here since 2009:
https://github.com/ceph/ceph/commit/85d893c5f5a3d85331e09ff89587330392c016fb

per stat(2)

       st_blocks
              This  field  indicates  the  number  of blocks allocated to the file, in 512-byte units.  (This may be
              smaller than st_size/512 when the file has holes.)

on ext4 filesystem:

build$ truncate -s 16M file1
build$ stat file1
  File: file1
  Size: 16777216        Blocks: 0          IO Block: 4096   regular file
Device: 8,17    Inode: 84200845    Links: 1
..

This isn't observed in ceph as it is based off of just file size: https://github.com/ceph/ceph/blob/1b53353dbdcb1a34745495fb7f27945380adf995/src/client/Client.cc#L8635

non-fscrypt dir in ceph:

mycephfs$ truncate -s 16M file1
mycephfs$ stat file1
  File: file1
  Size: 16777216        Blocks: 32768      IO Block: 4194304 regular file
Device: 0,45    Inode: 1099511667168  Links: 1
..

fscrypt dir in ceph:

fscrypt_test_unlocked_ffsb$ truncate -s 16M file1
fscrypt_test_unlocked_ffsb$ stat file1
  File: file1
  Size: 16777216        Blocks: 32768      IO Block: 4194304 regular file
Device: 0,45    Inode: 1099511667186  Links: 1
..

Actions

Also available in: Atom PDF