Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NSFS | Folders extended attributes #7020

Merged
merged 1 commit into from
Apr 27, 2023

Conversation

romayalon
Copy link
Contributor

@romayalon romayalon commented Jul 25, 2022

Signed-off-by: Romy romy2232@gmail.com

Explain the changes

  1. FS Napi - added dir_content xattr to the USER_XATTRS vector.

  2. test_namespace_fs - added unit tests

  3. namespace_fs -

    b. list objects -
    - Skipped processing entry when entry is .folder file.
    - Checked existence of XATTR_DIR_CONTENT xattr in the dir's xattr in process_dir and when evaluated to true the entry will be added to the objects list (when no delimiter or in other corner cases)

    c. read_object_md - added true to the call of get_version_path in order to get the directory path and not the .folder file when object is a directory content object.

    d. upload_object / complete_multipart_upload -
    d.1. upload_object -
    * Created the .folder file only when content size > 0 when the entry is a directory.
    * Created _create_empty_dir_content function for the creation of directory objects of size 0 - this function created
    the directory key, sets the xattr on the directory, deleted the old directory if exists, and returns directory info as a
    upload_info response.
    * On non-empty dir content - added a check to finish_upload() to not set the xattr on the object itself but put it on the
    directory instead.
    d.2. mpu -
    * we always create a .folder file as we assume the size is always > 0
    * when object is a dir content object -
    - skipped set xattr on .folder.
    - replaced old xattr with new xattr and added XATTR_DIR_OBJ xattr to the directory.
    - no override case - as we assume size > 0.

    e. delete_object / delete_multiple_objects -
    - Unlink - skipped when the file is .folder and error code is ENOENT (needed for directory objects of size 0)
    - Called clear xattr on directories ( needed for non-empty directory objects )

    f. get_object - called stat when the file is .folder and checked if XATTR_DIR_CONTENT xattr exists, if yes, returned {}; (needed for directory objects of size 0)

Issues: Fixed #xxx / Gap #xxx

  1. gap - upgrade script for existing directory objects (need to copy .folder xattr to the folder itself)
  2. Fixed #NSFS dir attrs should be taken from the dir itself and use a .folder subfile only if content is provided at all #6980

Testing Instructions:

  • Doc added/updated
  • Tests added

@romayalon romayalon force-pushed the romy-dirs-xattr branch 3 times, most recently from fc5c956 to c388426 Compare July 27, 2022 07:50
Copy link
Contributor

@jackyalbo jackyalbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mainly need more explanations. Also let's schedule a meeting in order to push this quicker.

src/native/fs/fs_napi.cpp Outdated Show resolved Hide resolved
src/sdk/namespace_fs.js Outdated Show resolved Hide resolved
src/sdk/namespace_fs.js Outdated Show resolved Hide resolved
@romayalon romayalon force-pushed the romy-dirs-xattr branch 9 times, most recently from 036735f to 6172b11 Compare September 4, 2022 15:10
src/native/fs/fs_napi.cpp Outdated Show resolved Hide resolved
src/sdk/namespace_fs.js Outdated Show resolved Hide resolved
src/sdk/namespace_fs.js Outdated Show resolved Hide resolved
src/sdk/namespace_fs.js Outdated Show resolved Hide resolved
src/sdk/namespace_fs.js Outdated Show resolved Hide resolved
src/sdk/namespace_fs.js Outdated Show resolved Hide resolved
src/sdk/namespace_fs.js Outdated Show resolved Hide resolved
src/sdk/namespace_fs.js Outdated Show resolved Hide resolved
src/sdk/namespace_fs.js Outdated Show resolved Hide resolved
src/sdk/namespace_fs.js Outdated Show resolved Hide resolved
Copy link
Member

@guymguym guymguym left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

godspeed

@romayalon romayalon force-pushed the romy-dirs-xattr branch 3 times, most recently from c8081ac to 3e79557 Compare September 29, 2022 15:47
@romayalon romayalon mentioned this pull request Oct 18, 2022
2 tasks
@dannyzaken
Copy link
Contributor

waiting for #6973

@romayalon romayalon marked this pull request as draft January 5, 2023 08:29
@romayalon romayalon force-pushed the romy-dirs-xattr branch 3 times, most recently from ce7ab01 to fae65a3 Compare March 14, 2023 19:48
@romayalon romayalon marked this pull request as ready for review March 16, 2023 17:13
src/sdk/namespace_fs.js Outdated Show resolved Hide resolved
src/sdk/namespace_fs.js Outdated Show resolved Hide resolved
src/sdk/namespace_fs.js Outdated Show resolved Hide resolved
src/sdk/namespace_fs.js Show resolved Hide resolved
@romayalon romayalon force-pushed the romy-dirs-xattr branch 2 times, most recently from 4b11292 to 2102b2c Compare March 28, 2023 07:48
@romayalon romayalon force-pushed the romy-dirs-xattr branch 3 times, most recently from dbea645 to 1a8eb1f Compare April 27, 2023 07:18
Signed-off-by: Romy <romy2232@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants