From 26d25608b6139ef5dbef6f724591a930dcb79b4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20L=C3=A1ska?= Date: Fri, 1 Mar 2019 09:58:00 +0100 Subject: [PATCH 1/3] Fixed documentation for return lfs_dir_read return value. lfs_dir_read breaks the convention of returning non-zero on success, this feature should be at least documented. --- lfs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lfs.h b/lfs.h index 9c3174e..b346008 100644 --- a/lfs.h +++ b/lfs.h @@ -448,7 +448,8 @@ int lfs_dir_close(lfs_t *lfs, lfs_dir_t *dir); // Read an entry in the directory // // Fills out the info structure, based on the specified file or directory. -// Returns a negative error code on failure. +// Returns a positive value on success, 0 at the end of directory, +// or a negative error code on failure. int lfs_dir_read(lfs_t *lfs, lfs_dir_t *dir, struct lfs_info *info); // Change the position of the directory From 905727b6844075bce1054f60ba6beb4437b6ea37 Mon Sep 17 00:00:00 2001 From: Ajay Bhargav Date: Sun, 17 Feb 2019 17:09:58 +0530 Subject: [PATCH 2/3] Fix: length more than LFS_FILE_MAX should return error To make lfs_file_truncate inline with ftruncate function, when -ve or size more than maximum file size is passed to function it should return invalid parameter error. In LFS case LFS_ERR_INVAL. Signed-off-by: Ajay Bhargav --- lfs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lfs.c b/lfs.c index 25c88c6..99ab36e 100644 --- a/lfs.c +++ b/lfs.c @@ -2864,6 +2864,10 @@ int lfs_file_truncate(lfs_t *lfs, lfs_file_t *file, lfs_off_t size) { return LFS_ERR_BADF; } + if (size > LFS_FILE_MAX) { + return LFS_ERR_INVAL; + } + lfs_off_t oldsize = lfs_file_size(lfs, file); if (size < oldsize) { // need to flush since directly changing metadata From 25a843aab739c88fe773139e11bc4de5ee2c6b79 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Fri, 12 Apr 2019 15:13:00 -0500 Subject: [PATCH 3/3] Fixed .travis.yml to use explicit branch names for migration testing This lets us actually update the littlefs-fuse repo instead of being bound to master for v1. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a69ecea..1a45b96 100644 --- a/.travis.yml +++ b/.travis.yml @@ -139,7 +139,7 @@ jobs: install: - sudo apt-get install libfuse-dev - git clone --depth 1 https://github.com/geky/littlefs-fuse -b v2-alpha v2 - - git clone --depth 1 https://github.com/geky/littlefs-fuse v1 + - git clone --depth 1 https://github.com/geky/littlefs-fuse -b v1 v1 - fusermount -V - gcc --version before_script: