Giter Site home page Giter Site logo

itri-sofa / sofa Goto Github PK

View Code? Open in Web Editor NEW
41.0 41.0 11.0 2.69 MB

SOFA (Software Orchestrated Flash Array) is a log-structured flash array management system

License: Apache License 2.0

Shell 4.61% Makefile 1.59% C 67.33% C++ 3.76% Hack 0.03% Java 5.97% CSS 1.74% JavaScript 14.13% Awk 0.03% Roff 0.48% Perl 0.32%

sofa's People

Contributors

itri-sofa avatar peter-huang0402 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sofa's Issues

Eliminate the use of dangerous fgets()

Reported by Cppcheck:

[src/common/sofa_config.c:972]: (error) Buffer is accessed out of bounds: osdisk_name

The corresponding code:

    if (fgets(osdisk_name, CFG_VALSET_STR_LEN, fp) != NULL) {
        if (osdisk_name[0] != 0) {
            _remove_char_str(osdisk_name, strlen(osdisk_name), '\n');
            set_config_item(STR_OSDISK_NAME, osdisk_name, NULL);
            strcpy(osdisk_ret, osdisk_name);
            syslog(LOG_INFO, "[SOFA] USERD INFO get os disk: %s\n",
                   osdisk_name);
            ret = 0;
        } else {

Quoted from Deprecated string input functions - fget:

The fgets ("file get string") function is similar to the gets function. This function is deprecated -- that means it is obsolete and it is strongly suggested you do not use it -- because it is dangerous. It is dangerous because if the input data contains a null character, you can't tell. Don't use fgets unless you know the data cannot contain a null. Don't use it to read files edited by the user because, if the user inserts a null character, you should either handle it properly or print a clear error message. Always use getline or getdelim instead of fgets if you can.

Uncertain license terms for sofa kernel module

The source file src/sofa_main/sofa_module_init.c declares itself as Apache License v2. However, by the end of this file, the kernel module are about to be registered as GPL via the macro MODULE_LICENSE("GPL"). The incompatibility between GPLv2/v3 and Apache License were discussed here: https://www.apache.org/licenses/GPL-compatibility.html

Therefore, the current implementation causes the uncertainty regarding licensing terms in sofa module for Linux kernel.

odd-unstable/even-stable style of versioning is dropped in Linux kernel

The file release_notes.txt mentions the following policy on versions:

Our SOFA starts with 1.0.0 version and follows the rule of Linux Kernel release.

However, such odd-unstable/even-stable style of versioning is already dropped by Linux kernel. Thus, it is not an effective role model to refer.

Decouple Linux kernel module from sofa package

The build script attempts to package sofa.ko into single RPM, that causes several problems:

  1. The generated RPM is coupled with certain Linux kernel version/build. Once the system is upgraded, the user space services might fail to interact with newer kernels.
  2. It is unlikely to deploy packages to different machines even with the consistent hardware configurations because of insistent Linux kernel configurations.
  3. Since kernel module and user space programs have different licensing terms (GPL vs. Apache license), it is really confusing to declare single license for RPM.

To overcome the above, decoupling Linux kernel modules from sofa package is a feasible approach. That is, there should be at least two packages: 1) sofa service/utility; 2) sofa kernel module for Linux;

Unable to build Linux kernel module for v4.15

I managed to build sofa on Ubuntu Linux 18.04-LTS which is based on Linux kernel version 4.15. However, I failed to build Linux kernel module. Here are the instructions to reproduce:

cd src
sh build_sofa.sh

The build system complained as following:

sofa/src/storage_core/lfsm/common/mem_manager.c: In function 'init_memory_manager':
sofa/src/storage_core/lfsm/common/mem_manager.c:42:10: error: implicit declaration of function 'bioset_init'; did you mean 'bio_init'? [-Werror=implicit-function-declaration]
          bioset_init(&memMgr.bioset, bio_pool_size, 0,
          ^~~~~~~~~~~
          bio_init
sofa/src/storage_core/lfsm/common/mem_manager.c: In function 'rel_memory_manager':
sofa/src/storage_core/lfsm/common/mem_manager.c:115:5: error: implicit declaration of function 'bioset_exit'; did you mean 'bioset_free'? [-Werror=implicit-function-declaration]
     bioset_exit(&memMgr.bioset);
     ^~~~~~~~~~~
     bioset_free
cc1: some warnings being treated as errors

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.