Date: Thu, 28 Apr 2016 19:26:27 -0400 (EDT) From: Rick Macklem <rmacklem@uoguelph.ca> To: freebsd-fs <freebsd-fs@freebsd.org> Subject: review of 2 fuse patches Message-ID: <738276500.82484810.1461885987214.JavaMail.zimbra@uoguelph.ca> In-Reply-To: <683515500.82484581.1461885974792.JavaMail.zimbra@uoguelph.ca>
next in thread | previous in thread | raw e-mail | index | archive | help
------=_Part_82484807_1596909650.1461885987209 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Hi, I've attached two small patches for fuse. (They both are in PR#206238.) Is anyone willing to review these? fuse-wronly.patch - Fixes a problem where the fuse interface has a file opened write-only and a write of a partial buffer cache block is done. At that point, the buffer cache code tries to read the block in and this fails, since the file isn't opened for reading. (The thread basically gets hung in the buffer cache code retrying the read over and over...) I could see two fixes for this: 1 - Always open files read-write when write-only opens are specified. (The problem with this is that a user might have write, but not read access to the file.) 2 - When files are opened write-only, force DirectIO, so that the buffer cache isn't used. *** This patch implements #2. fuse-createio.patch - This simple patch fixes the code so that it obeys the fuse file system's request that an open/create uses DirectIO. (Without this patch, fuse ignores the flag in the file system's reply and does buffered I/O.) This is apparently needed by MooseFS. (This patch assumes that fuse-wronly.patch has already been applied.) Thanks in advance for any review, rick ps: If you want these in phabricator, let me know. However they seem pretty straightforward, except for "how to fix the first problem?". ------=_Part_82484807_1596909650.1461885987209 Content-Type: text/x-patch; name=fuse-createio.patch Content-Disposition: attachment; filename=fuse-createio.patch Content-Transfer-Encoding: base64 LS0tIGZzL2Z1c2UvZnVzZV92bm9wcy5jLnNhdjUJMjAxNi0wMS0xNSAxNzoxNDo0NC4xMDUxOTQw MDAgLTA1MDAKKysrIGZzL2Z1c2UvZnVzZV92bm9wcy5jCTIwMTYtMDEtMTUgMTc6MTQ6NDkuNzIz Nzk5MDAwIC0wNTAwCkBAIC0xMTU4LDcgKzExNTgsOCBAQCBmdXNlX3Zub3Bfb3BlbihzdHJ1Y3Qg dm9wX29wZW5fYXJncyAqYXApCiAJCWZ1ZmhfdHlwZSA9IEZVRkhfUkRPTkxZOwogCX0gZWxzZSB7 CiAJCWZ1ZmhfdHlwZSA9IGZ1c2VfZmlsZWhhbmRsZV94bGF0ZV9mcm9tX2ZmbGFncyhtb2RlKTsK LQkJaWYgKGZ1ZmhfdHlwZSA9PSBGVUZIX1dST05MWSkKKwkJaWYgKGZ1ZmhfdHlwZSA9PSBGVUZI X1dST05MWSB8fAorCQkgICAgKGZ2ZGF0LT5mbGFnICYgRk5fRElSRUNUSU8pICE9IDApCiAJCQlm dXNlX29wZW5fZmxhZ3MgPSBGT1BFTl9ESVJFQ1RfSU87CiAJfQogCg== ------=_Part_82484807_1596909650.1461885987209 Content-Type: text/x-patch; name=fuse-wronly.patch Content-Disposition: attachment; filename=fuse-wronly.patch Content-Transfer-Encoding: base64 LS0tIGZzL2Z1c2UvZnVzZV9maWxlLmMueHh4CTIwMTUtMTItMjggMTA6NDI6MjYuOTE3ODU1MDAw IC0wNTAwCisrKyBmcy9mdXNlL2Z1c2VfZmlsZS5jCTIwMTUtMTItMjggMTE6NDY6NTYuOTA5NDU0 MDAwIC0wNTAwCkBAIC0xNDEsNyArMTQxLDE3IEBAIGZ1c2VfZmlsZWhhbmRsZV9vcGVuKHN0cnVj dCB2bm9kZSAqdnAsCiAJZm9vID0gZmRpLmFuc3c7CiAKIAlmdXNlX2ZpbGVoYW5kbGVfaW5pdCh2 cCwgZnVmaF90eXBlLCBmdWZocCwgZm9vLT5maCk7Ci0JZnVzZV92bm9kZV9vcGVuKHZwLCBmb28t Pm9wZW5fZmxhZ3MsIHRkKTsKKworCS8qCisJICogRm9yIFdST05MWSBvcGVucywgZm9yY2UgRElS RUNUX0lPLiAgVGhpcyBpcyBuZWNlc3NhcnkKKwkgKiBzaW5jZSB3cml0aW5nIGEgcGFydGlhbCBi bG9jayB0aHJvdWdoIHRoZSBidWZmZXIgY2FjaGUKKwkgKiB3aWxsIHJlc3VsdCBpbiBhIHJlYWQg b2YgdGhlIGJs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ID0g ZnVzZV9maWxlaGFuZGxlX3hsYXRlX2Zyb21fZmZsYWdzKG1vZGUpOworCQkvKgorCQkgKiBGb3Ig V1JPTkxZIG9wZW5zLCBmb3JjZSBESVJFQ1RfSU8uICBUaGlzIGlzIG5lY2Vzc2FyeQorCQkgKiBz aW5jZSB3cml0aW5nIGEgcGFydGlhbCBibG9jayB0aHJvdWdoIHRoZSBidWZmZXIgY2FjaGUKKwkJ ICogd2lsbCByZXN1bHQgaW4gYSByZWFkIG9mIHRoZSBibG9jayBhbmQgdGhhdCByZWFkIHdvbid0 CisJCSAqIGJlIGFsbG93ZWQgYnkgdGhlIFdST05MWSBvcGVuLgorCQkgKi8KKwkJaWYgKGZ1Zmhf dHlwZSA9PSBGVUZIX1dST05MWSkKKwkJCWZ1c2Vfb3Blbl9mbGFncyA9IEZPUEVOX0RJUkVDVF9J TzsKIAl9CiAKIAlpZiAoZnVzZV9maWxlaGFuZGxlX3ZhbGlkKHZwLCBmdWZoX3R5cGUpKSB7Ci0J CWZ1c2Vfdm5vZGVfb3Blbih2cCwgMCwgdGQpOworCQlmdXNlX3Zub2RlX29wZW4odnAsIGZ1c2Vf b3Blbl9mbGFncywgdGQpOwogCQlyZXR1cm4gMDsKIAl9CiAJZXJyb3IgPSBmdXNlX2ZpbGVoYW5k bGVfb3Blbih2cCwgZnVmaF90eXBlLCBOVUxMLCB0ZCwgY3JlZCk7Cg== ------=_Part_82484807_1596909650.1461885987209--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?738276500.82484810.1461885987214.JavaMail.zimbra>