Commit Graph
29 Commits
Author SHA1 Message Date
Raghav Sharma 3458bceae0 xfs: handle missing attribute fork in VerifyForkoff check
For some files, devices, and directories with no xattrs xfs can set di_forkoff to 0, so make it a valid condition check in VerifyForkoff() method

Change-Id: I930529ad661c8c5f640c18b2d50dfeddfde5b7d4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10655
Reviewed-by: Adrien Destugues <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-04-10 12:30:09 +00:00
Raghav Sharma ca7f0655b1 fs_shell: add null check for std_ops
Some file systems (like exfat) can have std_ops set to NULL in file_system_module_info header, so have a null check before initializing it.

Change-Id: Icdea910c5600daca985ac4b74cae197c40b6ba89
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10542
Reviewed-by: nephele nephele <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-03-20 14:52:20 +00:00
Raghav Sharma 528554ac4b xfs: Add new incompatible feature flags
Change-Id: I66cf435b043888bd4230b8447a00ac6bfe3e028e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10467
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2026-03-20 14:51:02 +00:00
Raghav Sharma afaeb2d45d xfs: Fix incorrect directory entry name comparison
- Directory entry names were compared using strncmp() with
entry->namelen bytes, which could incorrectly report names
as equal when one name is a prefix of another (e.g. "dir1"
and "dir10").

- Move util functions hashFunction and hashLowerBound to Utility header.

- Disable xfs TRACE logs to not pollute syslogs.

Change-Id: I2b158bfa6b815d7576a880055f794ffe89d0eb22
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10357
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2026-02-26 17:00:40 +00:00
Raghav Sharma 38a4926d9b xfs: identify and scan xfs partitions
Change-Id: Idb94cfec488e3246e983f5fc916c6273fcdd0674
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10331
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-02-20 15:02:42 +00:00
Raghav Sharma 53a3cd8bd5 xfs: fix SMAP violation during file read
Change-Id: I5106cfeef8e13462ce7402dbe6255f270176d1be
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10332
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2026-02-17 07:26:28 +00:00
Raghav Sharma 523068c0c0 xfs: Implement rewind_dir() hook for Tracker to list entries
Tracker extensively uses vfs_rewind_dir() hook before it lists all entries as icons, implement this hook so Tracker can correctly list all entries on mounted XFS volumes

Change-Id: Ia52640577f5f92fb1b46df3d14f5ac5ad7ae1943
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10314
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2026-02-14 09:46:11 +00:00
Raghav Sharma ec9e6a082e xfs: Fix driver build error
A warning regarding redundant typedef is generated, remove it to pass Werror enabled build

Change-Id: Ib21be8c6b995d7d8bece51b0242c116673ca610b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10312
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-02-06 17:44:58 +00:00
Mashijams 43a8874973 xfs: remove unnecessary macros
No functional changes just remove all the clutter caused by macros and flags that are never used

Change-Id: Iac0cc3fd873dbf11a379b33e4371902fa1181804
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6405
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: John Scipione <[email protected]>
2023-05-04 14:43:22 +00:00
Mashijams c6bb93278e xfs: fix performance issue related to xattrs
xfs by default adds xattrs format as extents in inode for directories even when there are no disk blocks allocated to extents, this made our driver looking for invalid extents and caused performance issue.

By adding a simple check for number of attribute extents in inode we fix this issue.

Change-Id: Idf86bb7822926c2ea311f6bbc2dfdcbee4d8930f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6403
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-05-04 14:43:22 +00:00
Mashijams 28cea299f7 xfs: return B_OK in xfs_free_dir_cookie() function instead of B_NOT_SUPPORTED
Change-Id: If9fa6deff9057653e7cb717fe9fe6ef1b0964c40
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6401
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-05-02 15:14:16 +00:00
Mashijams 62a64d0a43 xfs: make Directory Iterator class an abstract class
Directory Iterator class represents one instance which could be Short, Extent, Leaf, Node or B+Tree, a good case for making it an abstract class

Change-Id: I925255caf4c4f8bc01a975740ef2ebf0bb2e1b49
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5764
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-10-28 16:54:43 +00:00
Mashijams 689f8e9060 xfs: minimised disk seeks for node xattrs
- Made GetNext() function in Node Attributes efficient by reducing disk seeks to number of Node entries

Change-Id: I4e2bf8fb1898676c30eca2c6d6f39dc1999ae2f8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5612
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-10-23 07:28:51 +00:00
Mashijams 518c994770 xfs: make static methods of abstract class instead of separate functions
Create() and Size() functions are now static methods of its corresponding abstarct class instead of separate functions

Change-Id: Iae15b8f2985843afe23fecdf49b1fcf6f7104e52
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5703
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-10-06 20:13:33 +00:00
Mashijams 40b5272d86 xfs: make common lower bound function for calculating index of Hash
Change-Id: I5e902031b0e2a1051a7f96ab94dca0dba0ca9112
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5698
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-10-02 09:30:26 +00:00
Mashijams 88131dc314 xfs: Node xattrs
- Implemented node based extended attributes support

- Both Versions of xfs node based extended attributes can be read now

Change-Id: I2d2915029435e7722cf463b1e2b5579b361dd592
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5606
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-10-02 09:30:26 +00:00
Mashijams efd335c77a xfs: leaf xattrs
- Implemented leaf based extended attributes on-disk headers

- Both version 4 and version 5 attributes can be read now

- Implemented all leaf headers check to ensure metadata integrity

Change-Id: Ifc3f2e433e991776bb02d1d38f621d5bd1554a4e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5600
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-10-02 09:30:26 +00:00
Mashijams 99071c0c0b xfs: Symbolic links support
- Necessary hooks for reading symlinks are implemented

- Added support for local symlinks

- Added support for extent based symlinks

- This patch completes #17791

Change-Id: If6847974562b21f751097df357326f4643eff757
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5621
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-09-24 08:23:38 +00:00
Mashijams b4b3f69fca xfs: extended attributes necessary hooks and shortform attributes support
- Implemented all necessary hooks for extended attributes in kernel_interface.cpp

- Implemented an abstract class attribute which will act as an interface between all forms of extended attributes in xfs

- An attempt to read shortform extended attributes

Change-Id: Icff9329b790f9fcfc0b078f61059795af9d9e486
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5570
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-09-12 14:04:23 +00:00
Mashijams b65cc53f48 xfs: fixing bugs, Enable Werror
Fixed bug on reading files inside Haiku using CAT command on shell

Fixed bug on reading small directories inside Haiku

Node directories can now be read fine, which fixes #17839

LongBlock verification is now through common VerifyHeader function

Change-Id: I1eb651bd084580c86d0facb919825e94488e43d2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5546
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-09-08 18:01:45 +00:00
Mashijams 4d5b9e6726 xfs: disable Werror
compiler generates a warning regarding using offsetof() function on a non - POD type class

disabling Werror will not break build due to this warning

Change-Id: Ic72210f92a257e80ad8de9327892cfca7454076e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5538
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2022-08-10 08:01:06 +00:00
Mashijams a3d8402537 Docs: xfs
Change-Id: I2da4c778801e4c34ffe75d19c0c5c9323979f5f0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5533
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-08-08 15:25:26 +00:00
Mashijams c912a3f230 xfs: Node, B+Tree based directories and v5 files support
-Implemented node and B+Tree based directories support for xfs v5

-Implemented file read support for xfs v5

-Implemented common template function for all data headers check

This patch completes #17783 and #17703

Change-Id: Id4389168d07f31a97e8867e3cb3321b4523b13c0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5483
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-07-24 10:40:24 +00:00
Mashijams acdb3654fe xfs: V5 block and leaf directories
- Implemented V5 Block directory fields and virtual extent data header class to handle both V4 and V5 block directories.

- Implemented V5 leaf directory fields and virtual extent leaf header class to handle both V4 and V5 leaf directories.

- Implemented all checks for buffer headers.

Change-Id: I8f994d9ba792f40ba827cd5cee915b7b11796ce3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5432
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-07-14 07:12:34 +00:00
Mashijams 6c478b54f6 xfs: version 3 Inodes and shortform directory
- Implemented xfs v5 inodes (known as v3 inodes) and necessary metadata integrity checks

- Implemented correct data fork pointer which handles both xfs v4 and v5 directories

- We can now read inodes and shortform directories for both xfs versions completely fine

Change-Id: I8a75ec1dc663d567d3bf6db64be4a27b55d709b3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5396
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-06-27 15:00:30 +00:00
Mashijams 9c4a46b318 xfs : version 5 superblock, checksum header file
- Implemented version 5 superblock fields and necessary macros.

- Checksum functions are implemented which will be used for crc verification and crc updates.

- fssh_kernal_priv.h ROUNDDOWN macro definition is consistent with kernal.h definition.

Change-Id: I49b7c939bfd3ea1bffc85b3db42bc678dcce75cd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5350
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-06-18 08:32:18 +00:00
Mashijams 05cb1b0e05 Filesystem : move crc files to shared folder
Moved crc32.c, CRCTable.cpp, CRCTable.h from ext2, and crc_table.c from the UDF filesystem to shared directory

Modified Jam files to use these files from shared directory for ext2 and UDF filesystem

Change-Id: Ie2c79ce0a3ec7d1ea497e725a288c31528dcaa86
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5343
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-05-27 17:12:06 +00:00
Mashijams b666bf3fd8 xfs : Enabling -Werror and fixing all build issues that result
This patch will fix almost all warnings we have in xfs code.
There are some which I haven't fixed yet, I added comments on
part of code which is giving error and its type as well.

I tested all the changes on xfs_shell and everything is
working fine.

Change-Id: I1af1d09e7eab7f2c2397193bd5a584c5d40c424c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5257
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-05-17 11:28:43 +00:00
Mashijams 2cecdeed2e xfs : fix build with trace enabled, improve error checks
- Remove referencing an undeclared identifier

    - Instead of an assert, just log an error for XFS V5 filesystems
      and don't try to mount them

Change-Id: I67303aff89b81a28b7333569fea8113b6020dc54
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5204
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-04-28 19:16:12 +00:00