Commit Graph

109 Commits

Author SHA1 Message Date
Salmān Aljammāz 64220e06ff fs: set OpenDirectIO in stats files to avoid having them cached in kernel
bazil.org/fuse switched from having OpenDirectIO on to having it
off by default. This has the side effect of allowing OS X's kernel
to cache the filesystem's files in its UBC, giving us incorrect
stats from cammount's .camli_fs_stats directory. This change sets
it explicitly to get the correct behaviour again.

Updates #556

Change-Id: Ic6400a550e4874086cf5fb725d423fcfde47fd61
2014-12-26 18:09:32 +00:00
Salmān Aljammāz 972c4152fd fs: make a copy of the value buffer when setting an xattr
When setting an xattr bazil.org/fuse gives us a byte slice with the
attribute value to set, but it then reuses its backing array and
we end up with garbage values in our xattr maps. This CL makes a
copy of the slice before it stores it.

Bonus edit: fix a debug message typo in muDir.Remove.

Fixes #556

Change-Id: I820d8cde3065f2949ff4c506ede705194a458afb
2014-12-24 00:08:50 +00:00
Robert Kroeger b091a52e9f Use the absolute diskutil path for unmounting
Unmounting a FUSE volume on Darwin fails if diskutil is not on one's
path. This is not the default on MacOS. Make the path absolute so that
FUSE volumes unmount successfully.

Change-Id: I255be19b5b12e3ebecffc6d29dc77b6504c27f1c
2014-12-16 06:41:38 -08:00
Jingguo Yao 3e4825a1c3 fs: correct the permission bit setting
Replace "executeBit" with "n.attr.Mode & 0100" in "0400 & executeBit".
The result is "0400 & n.attr.Mode & 0100" which is always 0. So
"n.attr.Mode" is always 0 after the assignment. The last two "&" should be
"|" in the assignment.

Change-Id: Iaeff864f330b9db07b8a3124b5c28ba1a3469e69
2014-11-09 13:53:23 +08:00
Matthieu Rakotojaona af0d711c01 Fix ReadDir for recent in cammount
Change-Id: I422393ec77034b8408094b663b34121a499ad4a7
2014-10-24 19:56:42 +02:00
Piotr S. Staszewski cac9aa4483 fs: handle directory permanode titles
Set corresponding permanode title on new root,
new directory and directory rename.

Change-Id: I5432e14ef57d6c0c5555b11e895e8b8ad6d8efcf
2014-07-15 08:41:05 +02:00
Eric Drechsel 7e11b360a3 fuse: fix crash populating non-permanode camliPath
https://code.google.com/p/camlistore/issues/detail?id=440

Change-Id: If3b186d03a29ea6b3c9f0945173ede8709e318d6
2014-05-08 22:33:13 +00:00
Brad Fitzpatrick bf94a73859 Get rid of SeekFetcher vs StreamingFetcher distinction and complexity.
StreamingFetcher is now just Fetcher, and its FetchStreaming is now
just Fetch.

SeekFetcher is gone. Blobs are max 16 MB anyway, so we can slurp to
memory when needed. The main thing that cared about SeekFetcher
was the GET handler, ServeBlobref, because http.ServeContent needed
one for range requests. That's rewritten in an earlier commit, using
the FakeSeeker from another earlier commit.

Lot of code got simpler as a result.

Change-Id: Ib819413e48a8f9b8d97f596d0fbf771dab211f11
2014-03-14 12:29:13 -07:00
Brad Fitzpatrick bfe7128e94 fs: avoid possible nil pointer crash
http://camlistore.org/issue/401

Change-Id: I7ae091798e2f250898f14ec325a89cbfad4ee6aa
2014-03-11 13:30:58 -07:00
mpl 3f0974ef13 tests: make sure camlistored is running before cammount
Context: http://camlistore.org/issue/385

Change-Id: I793298745096fc1696f01226698eb6682b24806d
2014-02-24 18:29:08 +01:00
mpl 2194134b70 fs: clean up mountpoints after tests
Otherwise they tend to annoyingly accumulate on long-lived hosts (such
as the  buildbot).

Change-Id: I41eb90423c1f98d8481fb3308c2cdcb74fc86ddd
2014-02-17 23:31:19 +01:00
Brad Fitzpatrick 433a312703 fs: fix bug picking recent filenames when file has no name
e.g. iphone uploads

Change-Id: Ieee398b6f43c261232bc9f6cc0c71cb97c5c49f8
2014-02-02 06:14:44 +01:00
Brad Fitzpatrick 3e0d6521b8 Merge branch 'master' of https://camlistore.googlesource.com/camlistore 2014-01-31 12:27:18 +01:00
Brad Fitzpatrick e5ad2282c4 fs: cache recent dir for a bit
Change-Id: Id85344038d38dedc134435463d96d8b836edbcd7
2014-01-31 11:50:22 +01:00
Dustin Sallings fff8db88a7 fs: tests for xattr operations
Change-Id: I0501a8ec69fb30df7104b105f8e07a1864d2b5f6
2014-01-30 17:57:32 -08:00
Tommi Virtanen 6cda29582b third_party: Switch FUSE library to bazil.org/fuse
import bazil.org/fuse at f6649cd46fb76b1e04ba9eeffb773cb189278d31
remove code.google.com/p/rsc/fuse.

Huge thanks to Tommi Virtanen for the fuse support.

Change-Id: I44b95ac1ea344648593c7376f83ca675a56077b3
2014-01-24 13:28:08 -08:00
Dustin Sallings 70e6306aaf fs: fix crash setting xattr on a root
Change-Id: I76f008bcffcf23c5936a0a16cabb9c5b7c9bbd99
2014-01-17 18:19:45 -08:00
Brad Fitzpatrick aef25ddd81 Merge "fs: don't issue Describe request with no blobs" 2014-01-11 06:48:27 +00:00
Dustin Sallings d634b02b2e fs: don't issue Describe request with no blobs
The request is unnecessary, and the server doesn't appreciate it.

fix http://camlistore.org/issue/335

Change-Id: Ie37f1d187883dbc86a365f536a12c6b9916bc8d9
2014-01-10 20:50:20 -08:00
Brad Fitzpatrick 9c87b07d74 Merge "if permanode or root name provided to cammount, create new mutDir, and mount it" 2014-01-10 22:14:28 +00:00
Dustin Sallings 333cdce979 Reuse memoized mutDirs and mutFiles.
This provides a considerably improved experience for from a single FUSE
client, but not for free.

New dirents introduced outside of FUSE will be visible on the normal
refresh interval.

Removals outside of FUSE are tricky because it's not possible to tell
the difference between a file that was locally created and hasn't made
it into the index yet from a file that was deleted remotely.

Specific dirents that change permanodes outside of FUSE are replaced.

Dirents that change properties outside of FUSE without changing
permanodes (e.g. content, etc...) are never picked up.

Change-Id: I7cc8eaea5951644809053fc97c28455e96508bd4
Fixes:  http://calistore.org/issue/328
2014-01-09 19:58:43 -08:00
Kristopher Cost 7ce12d53f4 if permanode or root name provided to cammount, create new mutDir, and mount it
Change-Id: I97b7508ccb3c564178cb4f0a7b9ff238e486d957
2014-01-09 11:32:45 -08:00
Dustin Sallings edc655a27a Reuse memoized roots on refresh
This is somewhat related to camlistore.org/issue/328

Change-Id: I6bf8d70a42fca886f6b004d65c346be7c0a3e61e
2014-01-07 14:46:08 -08:00
Dustin Sallings c2500c5444 fs: implement {mutFile,mutDir}.Access
On at least OS X, the stat(2) call will use an existing node without
issuing Lookup.  This introduces a filesystem inconsistency where a
delete removes an entry for further requests, but FUSE's cached access
of the node is still used for at least stat.

There's a call to Access directly against the node as retrieved from a
prior Lookup.  By invalidating the nodes when they're deleted and
verifying this at Access time, we keep things more consistent.

This isn't exactly camlistore.org/issue/324 as described, but it was
causing one of the tests to fail on OS X

Change-Id: Ib90a1de79d6d3960f96bac5b4fb448c952c4ba66
2014-01-06 23:47:28 -08:00
Dustin Sallings 8a5ce9c6a5 fs: memoize roots children
If we ever return a particular value for a root, we should continue to
return the same value to provide a consistent view.

camlistore.org/issue/324

Change-Id: I7cfad02ad742b0e70e333f70779d64ba163d68a6
2014-01-06 23:47:28 -08:00
Dustin Sallings c39fb7136d fs: logging cleanup
Change-Id: I9413ce5397453cb91c9293de4dd7dce62f79ccfe
2014-01-06 23:47:28 -08:00
Dustin Sallings c13717e788 fs: extended attribute support
This includes read-write support for extended attributes for mutable
files, and enough support on all other filesystem paths to prevent OS X
from falling back to AppleDouble files.

Change-Id: I2b275591f3bc69c25e1e9c8d59a7fa4cf0bb97ff
2014-01-02 12:02:10 -08:00
Dustin Sallings e0773c28d1 fs: don't log entire write contents
Change-Id: Ib9e89916e55020ecd498b32230ae8dc189a0116d
2013-12-30 12:54:50 -08:00
Dustin Sallings 3aa0ab0a84 fs: only return a permanode as a directory if we're sure it is
If a well-timed lookup occurs while a file is being created, after the
permanode is available, but before any attribute claims declaring file
content, the file will be assumed to be a directory.

Ideally, FUSE would only hold on to this mistake for about a minute, or
the duration of the attribute cache, but it's much longer in practice.
Even with cammount effectively disabling all caches and returning fresh
dirents with random inodes, FUSE seemingly never sent in another Lookup
request for the broken entry.

While I wouldn't consider this a fix for the condition at large, I do
believe being explicit about what's a file, symlink, or directory is the
correct thing to do.

See also: http://camlistore.org/issue/293

Change-Id: I64d4afc8dfdb87b9b121d161936dd613139f00e2
2013-12-28 13:34:53 -08:00
Dustin Sallings d768e5c5a6 FUSE time travel
Change-Id: I54f6c95629374fe2b578e4a0dec017fb9d724b32
2013-12-27 19:19:06 -08:00
Dustin Sallings c6768d8875 fuse: Enable tests on Linux; make them pass
This is essentially two things:

1. Trivial changes to fs_test to make it not skip on Linux
2. Move much of the logic that was in *mutFile.Release into *mutFile.Flush

See http://sourceforge.net/apps/mediawiki/fuse/index.php?title=FUSE_tutorial
and the FUSE FAQ for an explanation of Flush vs. Release.

Change-Id: Id63312b3f8ebf12917338b836beb8a7a736d4fe6
2013-12-27 11:51:17 -08:00
Brad Fitzpatrick 55955a7734 fs: fix other case where we're comparing Flags to 0 2013-12-26 14:11:20 -08:00
Brad Fitzpatrick 3f7dde054c fs: only reject read-only open if flags contain a blacklisted write flag 2013-12-26 13:55:27 -08:00
Dustin Sallings de98f54994 FUSE: support renaming roots
Change-Id: I2acdd9a59e1b031b1a9d02d3cd07f7b9b16818a5
2013-12-24 16:01:06 -08:00
Brad Fitzpatrick aa23c1b379 Merge "Support removing roots from FUSE" 2013-12-22 22:43:53 +00:00
Brad Fitzpatrick f4012ab4df Merge "List recent directory as mode 500" 2013-12-22 22:31:36 +00:00
Dustin Sallings f46840c42b List recent directory as mode 500
Nothing should ever write here, so let's not advertise a write bit.

Change-Id: I3d54199fc4a96c8c020f6d71d8e6bf2802cf45db
2013-12-22 13:46:34 -08:00
Dustin Sallings ae1a7aee58 EPERM any attempts to open files for writing in recent
Rather than allowing files to be opened read/write an than returning EIO
on actual writes, just don't let them be opened writable.

Change-Id: I73991e535adcde6eb012b28ae01537ffae1621bb
2013-12-22 13:06:39 -08:00
Dustin Sallings f9b9e39f6f Support removing roots from FUSE
Change-Id: I6929d416a6bbdad396da01210e86cb78b1f0c90b
2013-12-18 23:11:20 -08:00
Brad Fitzpatrick 9af5a970de Mark boring files generated by FUSE as "hidden", then hide in the UI.
Makes for prettier FUSE demos w/ files showing up live in the browser
with websockets.

Change-Id: I41cc9ae0d33db39b4dbbf5b60714cee9a79b7248
2013-12-13 13:27:48 +04:00
Brad Fitzpatrick 02eb1a6e97 fs: put all importer roots in the roots folder too 2013-11-21 17:51:34 -08:00
Tamás Gulácsi 161fc061d3 use syncutil.Group and syncutil.Gate for paralellizing blobserver stats/removes
- where TODO exist.

Change-Id: If7340cf3bfcd5f5211f646404312c2fd15947bd9
2013-10-10 21:52:12 +02:00
mpl 44ca418e4f Merge "camput attr: support -del" 2013-10-03 13:10:22 +00:00
mpl 304f5c4b38 camput attr: support -del
Change-Id: I28460fed5b572ba9a83cfcb04f38e42124fa723f
2013-10-03 15:07:43 +02:00
Burcu Dogan 251df7dc53 fs: unmount on linux
Unmount the mount point on quit key on Linux. Adding fallbacks
in case of umount failure.

Change-Id: Ibd52ff1886d396bb424ac8d8ba9f9d8cb94a36f9
2013-09-24 19:24:53 +02:00
Brad Fitzpatrick 0bdf20884b all: delete pkg/blobref; convert all from *blobref.BlobRef to new blob.Ref
Change-Id: Id2dfb7f19452bedf4f3c9310b36227fd8117b225
2013-08-03 19:54:30 -07:00
mpl e4e976e8a1 fs: typo in copyright date
Change-Id: I59cbf752971d7f1b9a8e6b291aec814d3b833378
2013-08-02 21:57:16 +02:00
Brad Fitzpatrick e8d0200a11 Merge "integration tests: kill camlistored when all tests are done" 2013-08-02 19:04:41 +00:00
mpl 5fa82a3abb integration tests: kill camlistored when all tests are done
-osutil: PollParent to monitor parent process.
-camlistored: option to kill itself if it has been orphaned.

Change-Id: I87193254d55847e46134439ecd1b04f71718d083
2013-08-02 15:42:49 +02:00
Brad Fitzpatrick 82bb3b71ca fs: add build tags to fs_test.go too
Change-Id: I5ccf451ce42f64578cd43405774fc9d7fdee1705
2013-07-29 14:14:32 -07:00