linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Antti Tönkyrä" <daedalus@pingtimeout.net>
To: bfields@fieldses.org
Cc: linux-nfs@vger.kernel.org
Subject: Patch for mapping EILSEQ into NFSERR_INVAL
Date: Mon, 02 Dec 2013 22:21:23 +0200	[thread overview]
Message-ID: <529CEBC3.8060505@pingtimeout.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 1219 bytes --]

Hello,

NTFS file system and some other filesystems seem to return EILSEQ when 
user passes badly formatted data. Current NFSv4 implementation does not 
map EILSEQ into any known NFSv4 error code which causes problems in some 
use cases. In my case I observed that if filesystem returns EILSEQ, the 
NFS share will begin I/O erroring until it's able to recover (If there 
are handles open to the files in the share, I/O errors will continue 
until they are closed after which the share recovers after small period 
of time).

Given that widely used ntfs-3g FUSE module also returns EILSEQ on the 
same case (I tested this) I would argue that a fix should be done for 
upstream especially since RFC5661 clearly defines that invalid UTF-8 
sequence should map into NFSERR_INVAL, exact quote: "Where the client 
sends an invalid UTF-8 string, the server should return NFS4ERR_INVAL 
(see Table 5)".

Other way of fixing this would be to change all EILSEQs to return 
something else but I think this is a wrong way to fix the problem since 
it takes the sane error message away (Invalid or incomplete multibyte or 
wide character).

If we simply do a mapping here then isn't the fix straightforward 
(attached)?

BR, Antti

[-- Attachment #2: proposed_mapping.patch --]
[-- Type: text/plain, Size: 469 bytes --]

diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c
index 54c6b3d..a022a23 100644
--- a/fs/nfsd/nfsproc.c
+++ b/fs/nfsd/nfsproc.c
@@ -724,6 +724,7 @@ nfserrno (int errno)
                { nfserr_notdir, -ENOTDIR },
                { nfserr_isdir, -EISDIR },
                { nfserr_inval, -EINVAL },
+               { nfserr_inval, -EILSEQ },
                { nfserr_fbig, -EFBIG },
                { nfserr_nospc, -ENOSPC },
                { nfserr_rofs, -EROFS },

             reply	other threads:[~2013-12-02 20:28 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-02 20:21 Antti Tönkyrä [this message]
2013-12-02 20:45 ` Patch for mapping EILSEQ into NFSERR_INVAL Trond Myklebust
2013-12-02 20:52   ` Antti Tönkyrä
2013-12-03 20:48     ` Dr Fields James Bruce
2013-12-03 21:22       ` Dr Fields James Bruce
2013-12-04  6:55         ` Antti Tönkyrä
2013-12-04 15:41           ` Dr Fields James Bruce
2013-12-04 20:44             ` Antti Tönkyrä
2013-12-04 21:03               ` Dr Fields James Bruce
2013-12-04 21:08                 ` Antti Tönkyrä
2013-12-04 21:22                 ` Trond Myklebust
2013-12-04 21:38                   ` Dr Fields James Bruce
2013-12-04 22:49                     ` Trond Myklebust
2013-12-05  8:39                       ` Antti Tönkyrä
2013-12-04 12:33         ` Antti Tönkyrä
2013-12-04 12:40           ` Antti Tönkyrä
2013-12-04  8:31 ` Christoph Hellwig
2013-12-04 11:15   ` Antti Tönkyrä
2013-12-04 11:19     ` Christoph Hellwig
2013-12-04 11:34       ` Antti Tönkyrä
2013-12-05 19:45         ` J. Bruce Fields

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=529CEBC3.8060505@pingtimeout.net \
    --to=daedalus@pingtimeout.net \
    --cc=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).