Opened 3 months ago

Last modified 3 days ago

#35740 assigned Bug

file_storage.tests.FileFieldStorageTests.test_extended_length_storage fails when bcachefs is in use

Reported by: Alyssa Ross Owned by: YashRaj1506
Component: File uploads/storage Version: 4.2
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

This test constructs a file name of the maximum permissible length reported by the filesystem, then checks that round-tripping it through a FileField with a max_length of 300. If the filesystem reports a maximum permissible length longer than 300, this won't work, because the name will have been truncated by the FileField.

Change History (7)

comment:1 by Alyssa Ross, 3 months ago

Owner: set to Alyssa Ross
Status: newassigned

comment:2 by Alyssa Ross, 3 months ago

Owner: Alyssa Ross removed
Status: assignednew

comment:3 by Sarah Boyce, 3 months ago

Summary: test_extended_length_storage fails on bcachefsfile_storage.tests.FileFieldStorageTests.test_extended_length_storage fails when bcachefs is in use

Refs #24826
Do you have a suggested patch?

comment:4 by Sarah Boyce, 3 months ago

Resolution: needsinfo
Status: newclosed

Increasing the max_length for extended_length might work but I can't find what this number should be for bcachefs.

  • tests/file_storage/models.py

    a b class Storage(models.Model):  
    8080        storage=temp_storage, upload_to="tests", max_length=20
    8181    )
    8282    extended_length = models.FileField(
    83         storage=temp_storage, upload_to="tests", max_length=300
     83        storage=temp_storage, upload_to="tests", max_length=2000
    8484    )

Can you share what _storage_max_filename_length returns for you?

comment:5 by Alyssa Ross, 2 months ago

Resolution: needsinfo
Status: closednew

Hi! Sorry, I missed the notification.

PC_NAME_MAX on bcachefs is 512.

comment:6 by Sarah Boyce, 2 months ago

Triage Stage: UnreviewedAccepted

comment:7 by YashRaj1506, 3 days ago

Owner: set to YashRaj1506
Status: newassigned
Note: See TracTickets for help on using tickets.
Back to Top