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

fsync: Operation not supported #587

Closed
ghost opened this issue Jul 29, 2021 · 9 comments
Closed

fsync: Operation not supported #587

ghost opened this issue Jul 29, 2021 · 9 comments

Comments

@ghost
Copy link

ghost commented Jul 29, 2021

Steps to reproduce:

  1. https://paste.debian.net/plain/1205931
  2. Pass any gocryptfs path as an argument.
    Error: fsync /path/: Operation not supported
@ghost ghost changed the title fsync: Operation not permitted fsync: Operation not supported Jul 29, 2021
@rfjakob
Copy link
Owner

rfjakob commented Jul 29, 2021

Can confirm for directories but not for normal files (see below)

$ ./a.out /tmp/tmp.4V62WJ9BI6/b/file 
(ok)

$ ./a.out /tmp/tmp.4V62WJ9BI6/b/dir
Error: fsync /tmp/tmp.4V62WJ9BI6/b/dir: Operation not supported

20 extra internet points for minimal reproducer C code:
⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐

@rfjakob
Copy link
Owner

rfjakob commented Jul 29, 2021

Relevant gocryptfs -fg -nosyslog -fusedebug log below. Looks like we don't implement FSYNCDIR:

14:22:46.856729 rx 28: LOOKUP n1 ["file"] 5b
14:22:46.856904 tx 28:     OK, {n3 g1 tE=1s tA=1s {M0100644 SZ=0 L=1 1026:1026 B0*4096 i0:22676 A 1627561080.433648 M 1627561080.433647 C 1627561080.432017}}
14:22:46.856946 rx 30: OPEN n3 {O_RDONLY,0x8000} 
14:22:46.856990 tx 30:     OK, {Fh 1 }
14:22:46.857036 rx 32: FSYNC n3 
14:22:46.857048 tx 32:     OK
14:22:46.857110 rx 34: FLUSH n3 {Fh 1} 
14:22:46.857126 tx 34:     OK
14:22:46.857215 rx 36: RELEASE n3 {Fh 1 0x8000  L0} 
14:22:46.857233 tx 36:     OK



14:22:56.038596 rx 38: LOOKUP n1 ["dir"] 4b
14:22:56.038708 tx 38:     OK, {n2 g1 tE=1s tA=1s {M040755 SZ=60 L=2 1026:1026 B0*4096 i0:22672 A 1627561056.976900 M 1627561056.976900 C 1627561056.976900}}
14:22:56.038746 rx 40: OPENDIR n2 
14:22:56.038775 tx 40:     OK, {Fh 1 }
14:22:56.038803 rx 42: FSYNCDIR n2 
14:22:56.038811 tx 42:     95=operation not supported
14:22:56.038869 rx 44: RELEASEDIR n2 {Fh 1 0x8000  L0} 
14:22:56.038875 tx 44:     OK

@ghost
Copy link
Author

ghost commented Jul 29, 2021

C code was all @/bremner on #notmuch @ irc.libera.chat. Does this project have an IRC channel?
Will FSYNCDIR be implemented?

@lechner
Copy link
Contributor

lechner commented Jul 29, 2021

With the Debian paste scheduled to expire on 2021-07-30 13:38:48, it seemed prudent to copy it here for posterity:

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>

int main (int argc, char **argv)
{
    int fd, r;

    fd = open (argv[1], O_RDONLY);
    if (fd == -1) {
	fprintf (stderr, "Error: open %s: %s\n", argv[1], strerror (errno));
	exit (1);
    }

    r = fsync (fd);
    if (r)
	fprintf (stderr, "Error: fsync %s: %s\n", argv[1], strerror (errno));

    close (fd);

    return r;
}

@rfjakob
Copy link
Owner

rfjakob commented Jul 29, 2021

Will FSYNCDIR be implemented?

Yes

@rfjakob
Copy link
Owner

rfjakob commented Jul 29, 2021

Fixed, thanks for the report!

@ghost
Copy link
Author

ghost commented Jul 30, 2021

Do you think you can cut a release?

@rfjakob
Copy link
Owner

rfjakob commented Jul 30, 2021

I want to fix a few more things before, but I can attach a build here if you want?

But as far as i saw in the notmuch code, the fsync message is just a warning, right?

@ghost
Copy link
Author

ghost commented Jul 30, 2021

Sure, I'll build it from source.
I don't think it was just a warning, notmuch operation aborted as soon as it hit fsync.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants