From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:57427 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750936AbdIKRA0 (ORCPT ); Mon, 11 Sep 2017 13:00:26 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 753C2AAC5 for ; Mon, 11 Sep 2017 17:00:25 +0000 (UTC) From: David Sterba To: linux-btrfs@vger.kernel.org Cc: David Sterba Subject: [PATCH] btrfs: send: fix error code if an unknown inode type is found Date: Mon, 11 Sep 2017 18:58:54 +0200 Message-Id: <20170911165854.19460-1-dsterba@suse.com> Sender: linux-btrfs-owner@vger.kernel.org List-ID: 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 --- 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