-
Notifications
You must be signed in to change notification settings - Fork 305
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
rofiles: Add --copyup option #1382
Changes from 1 commit
5becda7
bcae27b
3fdcb9e
086efd6
ab634a2
eec2ff2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -385,7 +385,12 @@ do_open (const char *path, mode_t mode, struct fuse_file_info *finfo) | |
if (opt_copyup) | ||
{ | ||
(void) close (fd); | ||
fd = openat (basefd, path, finfo->flags & ~O_TRUNC, mode); | ||
/* Note that unlike the initial open, we will pass through | ||
* O_TRUNC. More ideally in this copyup case we'd avoid copying | ||
* the whole file in the first place, but eh. It's not like we're | ||
* high performance anyways. | ||
*/ | ||
fd = openat (basefd, path, finfo->flags & ~(O_EXCL|O_CREAT), mode); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we filtering out There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're internally reopening the file we just created. So if the user provided |
||
if (fd == -1) | ||
return -errno; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, so then we don't need to
ftruncate
down below again, right? Shouldn't theif
condition at 399 be changed to?