From: David Sterba <dsterba@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.com>
Subject: [PATCH] btrfs: send: fix error code if an unknown inode type is found
Date: Mon, 11 Sep 2017 18:58:54 +0200 [thread overview]
Message-ID: <20170911165854.19460-1-dsterba@suse.com> (raw)
There are two types for "not supported", but the correct one is
EOPNOTSUPP, let's use that one. The error message in the error case is
not very helpful, enhance it at least with the inode number.
The unknown type seems to be the block device (S_IFBLK)(as it's the only
unhandled case. Adding this type would need to extend the send protocol,
so this needs to stay as 'not supported'.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=196903
Signed-off-by: David Sterba <dsterba@suse.com>
---
fs/btrfs/send.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index 8f1d3d6e7087..5f944f9135d6 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -2638,9 +2638,9 @@ static int send_create_inode(struct send_ctx *sctx, u64 ino)
} else if (S_ISSOCK(mode)) {
cmd = BTRFS_SEND_C_MKSOCK;
} else {
- btrfs_warn(sctx->send_root->fs_info, "unexpected inode type %o",
- (int)(mode & S_IFMT));
- ret = -ENOTSUPP;
+ btrfs_warn(fs_info, "unexpected type 0%o of inode %llu",
+ (int)(mode & S_IFMT), ino);
+ ret = -EOPNOTSUPP;
goto out;
}
--
2.14.0
next reply other threads:[~2017-09-11 17:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-11 16:58 David Sterba [this message]
2017-09-12 3:02 ` [PATCH] btrfs: send: fix error code if an unknown inode type is found Tsutomu Itoh
2017-09-12 11:13 ` David Sterba
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=20170911165854.19460-1-dsterba@suse.com \
--to=dsterba@suse.com \
--cc=linux-btrfs@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