[PR #403] [MERGED] Fix a bug of truncating empty file #1493

Closed
opened 2026-03-04 01:54:14 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/403
Author: @rockuw
Created: 4/22/2016
Status: Merged
Merged: 4/26/2016
Merged by: @ggtakec

Base: masterHead: master


📝 Commits (2)

  • 115bd51 Fix a bug of truncating empty file
  • cf23dc7 Use 'return' instead of 'exit' in test

📊 Changes

2 files changed (+21 additions, -2 deletions)

View changed files

📝 src/curl.cpp (+2 -2)
📝 test/integration-test-main.sh (+19 -0)

📄 Description

The following steps report error, which should NOT:

ubuntu@ip-172-31-29-108:~/s3fs-fuse$ touch /tmp/s3fs/a
ubuntu@ip-172-31-29-108:~/s3fs-fuse$ ll /tmp/s3fs/a
-rw-rw-r-- 1 ubuntu ubuntu 0 Apr 22 06:48 /tmp/s3fs/a
ubuntu@ip-172-31-29-108:~/s3fs-fuse$ truncate /tmp/s3fs/a -s 1024
truncate: failed to truncate ‘/tmp/s3fs/a’ at 1024 bytes: Operation not permitted

This patch fixes this bug.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/s3fs-fuse/s3fs-fuse/pull/403 **Author:** [@rockuw](https://github.com/rockuw) **Created:** 4/22/2016 **Status:** ✅ Merged **Merged:** 4/26/2016 **Merged by:** [@ggtakec](https://github.com/ggtakec) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (2) - [`115bd51`](https://github.com/s3fs-fuse/s3fs-fuse/commit/115bd51f3fbbc4bf7a415c743237a453c634d104) Fix a bug of truncating empty file - [`cf23dc7`](https://github.com/s3fs-fuse/s3fs-fuse/commit/cf23dc78ab5983c3dcca0a308cd3528e61118b46) Use 'return' instead of 'exit' in test ### 📊 Changes **2 files changed** (+21 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/curl.cpp` (+2 -2) 📝 `test/integration-test-main.sh` (+19 -0) </details> ### 📄 Description The following steps report error, which should NOT: ``` bash ubuntu@ip-172-31-29-108:~/s3fs-fuse$ touch /tmp/s3fs/a ubuntu@ip-172-31-29-108:~/s3fs-fuse$ ll /tmp/s3fs/a -rw-rw-r-- 1 ubuntu ubuntu 0 Apr 22 06:48 /tmp/s3fs/a ubuntu@ip-172-31-29-108:~/s3fs-fuse$ truncate /tmp/s3fs/a -s 1024 truncate: failed to truncate ‘/tmp/s3fs/a’ at 1024 bytes: Operation not permitted ``` This patch fixes this bug. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 01:54:14 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#1493
No description provided.