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

-idle option not working properly #421

Closed
bertogg opened this issue Sep 7, 2019 · 2 comments
Closed

-idle option not working properly #421

bertogg opened this issue Sep 7, 2019 · 2 comments
Labels

Comments

@bertogg
Copy link

bertogg commented Sep 7, 2019

The -idle option should unmount the filesystem if it has been idle for the specified amount of time.

However it seems to do it always, regardless of whether the filesystem is idle or not.

This script should create a new filesystem, mount it (with -idle 20s), create a directory inside it, and create 100 files, one every 5 seconds.

This should guarantee that the filesystem is always busy so all 100 files should be created. However the filesystem is unmounted after 20 seconds and the script exits with an error.

I tested this with gocryptfs 1.7

#!/bin/sh

set -eu

DIR=`mktemp -d /tmp/tmpdir.XXXXXX`
mkdir $DIR/crypt $DIR/plain

echo foo | gocryptfs -init $DIR/crypt
echo foo | gocryptfs -idle 20s $DIR/crypt $DIR/plain

mkdir $DIR/plain/data

for f in `seq -w 0 99`; do
    date
    echo sometext > $DIR/plain/data/$f
    ls $DIR/plain/data
    sleep 5
done

fusermount -u $DIR/plain
@rfjakob rfjakob added the bug label Sep 7, 2019
@rfjakob
Copy link
Owner

rfjakob commented Sep 7, 2019

Thanks for the report. I looked at the code and I think I see the problem, and how to fix this.

@rfjakob
Copy link
Owner

rfjakob commented Sep 7, 2019

Note to self: we have a test that checks that -idle unmounts as expected, but we do not have a test that -idle does NOT unmount when the filesystem is active.

rfjakob added a commit that referenced this issue Sep 8, 2019
Mount with idle timeout of 100ms read something every 10ms. The fs should
NOT get unmounted. Regression test for #421
@rfjakob rfjakob closed this as completed in 0a4db7d Sep 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants