From patchwork Fri Jan 18 16:14:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jann Horn X-Patchwork-Id: 10770837 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 89FA66C2 for ; Fri, 18 Jan 2019 16:15:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 772852F571 for ; Fri, 18 Jan 2019 16:15:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6AC282F642; Fri, 18 Jan 2019 16:15:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 034AE2F571 for ; Fri, 18 Jan 2019 16:15:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728013AbfARQPC (ORCPT ); Fri, 18 Jan 2019 11:15:02 -0500 Received: from mail-yw1-f73.google.com ([209.85.161.73]:54447 "EHLO mail-yw1-f73.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727568AbfARQPB (ORCPT ); Fri, 18 Jan 2019 11:15:01 -0500 Received: by mail-yw1-f73.google.com with SMTP id f10so7128833ywc.21 for ; Fri, 18 Jan 2019 08:15:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=acKuHWDxCAo2HtjYv0zQtkcTtJK21uLYyRX29pjdtaY=; b=OOyZK/XV1Jf2ajxcEWDA2gNbmCgZ01lv9jDs5rhxuE11ERFuA+qJCOuXhBuUgVc5Nm AqgltZ82enjTRDDWDBYQW3yYdDVAjtLQbe8gpl8f5ZG8cJ1fCo8Q47CqvXoxANRYA1GV Rk9yt7+262HG/5T6fv1J9FCZfMi30ksa9EeLFaa4skxzjylHpN4SbHb8osRYGDEKR6Hk 8Rmr/NW/00g9X5yLT7/66sPw6D7/7/vjCSmLWM+xz8owAj8Y1l9ifR6/QmwAHeN1H8tD YTVbl1t7b8FB963/C0+dTasPIvpFm52jx3yZkI9m9i9gwICGMHbwu6kq3vapYIxrHXZ6 JtEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=acKuHWDxCAo2HtjYv0zQtkcTtJK21uLYyRX29pjdtaY=; b=cCtcgkOjb8WiTV+WVOAGYvN6BpGt8KzSqYKkv6uDLT7m68ZTRtVN8YX+47QdI+Vdry P76h0o0NTYqBed5oQfUtECnXdeHVZr/R2lFTpmXJf+sUjWAnTaXIbKz8HBNHbf3ajn9w LLa4wQl9vKXp7MfD1HP/3bwxYOoeykvg7fkso8no+DtZ3paG/wnAy/BAmTy+Onx87Le2 E28NAKxBKXymksIIk4VY17sc9w8ue2Q6o0mvV8Ne4qAMENAxX3H8U8WdX9A9m80jrFfG IsytK2Zl/TrFWIpHO+R+yV59Z4bWdxyLc6QLZlu5pbFovrDuq84KBT8c6oRdqYE6EOto naRw== X-Gm-Message-State: AJcUukchLMwwgIeCTkbMD3GXBOtnXPz3uFrYWxslvMccN05jr/0Zdj+B Vl4IDbmC3FQO507kxICjbGuA43OkPQ== X-Google-Smtp-Source: ALg8bN6WwyE31vQy/QLWcGSt63VbxDzoBHIcTgnWRt/U+D9i0B2yEe0Epxbgaf+avn6IqoKxIxVeqO2moA== X-Received: by 2002:a81:52c7:: with SMTP id g190mr9425001ywb.4.1547828100227; Fri, 18 Jan 2019 08:15:00 -0800 (PST) Date: Fri, 18 Jan 2019 17:14:38 +0100 Message-Id: <20190118161440.220134-1-jannh@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.20.1.321.g9e740568ce-goog Subject: [PATCH v4 1/3] fs: hoist EFSCORRUPTED definition into uapi header From: Jann Horn To: Richard Henderson , Ivan Kokshaysky , Matt Turner , Alexander Viro , linux-fsdevel@vger.kernel.org, Arnd Bergmann , jannh@google.com Cc: "Eric W. Biederman" , "Theodore Ts'o" , Andreas Dilger , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Dave Chinner , Pavel Machek , linux-arch@vger.kernel.org, linux-api@vger.kernel.org Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Multiple filesystems can already return EFSCORRUPTED errors to userspace; however, so far, definitions of EFSCORRUPTED were in filesystem-private headers. I wanted to use EUCLEAN to indicate data corruption in the VFS layer; Dave Chinner says that I should instead hoist the definitions of EFSCORRUPTED into the UAPI header and then use EFSCORRUPTED. This patch is marked for stable backport because it is a prerequisite for the following patch. Cc: stable@vger.kernel.org Suggested-by: Dave Chinner Signed-off-by: Jann Horn Acked-by: Arnd Bergmann Acked-by: Dave Chinner --- fs/ext2/ext2.h | 1 - fs/ext4/ext4.h | 1 - fs/xfs/xfs_linux.h | 1 - include/linux/jbd2.h | 1 - include/uapi/asm-generic/errno.h | 1 + 5 files changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/ext2/ext2.h b/fs/ext2/ext2.h index e770cd100a6a..7fafc19e5aa0 100644 --- a/fs/ext2/ext2.h +++ b/fs/ext2/ext2.h @@ -369,7 +369,6 @@ struct ext2_inode { */ #define EXT2_VALID_FS 0x0001 /* Unmounted cleanly */ #define EXT2_ERROR_FS 0x0002 /* Errors detected */ -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */ /* * Mount flags diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 185a05d3257e..9397e97fc15b 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -3247,6 +3247,5 @@ extern const struct iomap_ops ext4_iomap_ops; #endif /* __KERNEL__ */ #define EFSBADCRC EBADMSG /* Bad CRC detected */ -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */ #endif /* _EXT4_H */ diff --git a/fs/xfs/xfs_linux.h b/fs/xfs/xfs_linux.h index edbd5a210df2..36e5c6549f15 100644 --- a/fs/xfs/xfs_linux.h +++ b/fs/xfs/xfs_linux.h @@ -125,7 +125,6 @@ typedef __u32 xfs_nlink_t; #define ENOATTR ENODATA /* Attribute not found */ #define EWRONGFS EINVAL /* Mount with wrong filesystem type */ -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */ #define EFSBADCRC EBADMSG /* Bad CRC detected */ #define SYNCHRONIZE() barrier() diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index 0f919d5fe84f..1d0da9c78216 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h @@ -1640,6 +1640,5 @@ static inline tid_t jbd2_get_latest_transaction(journal_t *journal) #endif /* __KERNEL__ */ #define EFSBADCRC EBADMSG /* Bad CRC detected */ -#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */ #endif /* _LINUX_JBD2_H */ diff --git a/include/uapi/asm-generic/errno.h b/include/uapi/asm-generic/errno.h index cf9c51ac49f9..5ddebc1bf951 100644 --- a/include/uapi/asm-generic/errno.h +++ b/include/uapi/asm-generic/errno.h @@ -98,6 +98,7 @@ #define EINPROGRESS 115 /* Operation now in progress */ #define ESTALE 116 /* Stale file handle */ #define EUCLEAN 117 /* Structure needs cleaning */ +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */ #define ENOTNAM 118 /* Not a XENIX named type file */ #define ENAVAIL 119 /* No XENIX semaphores available */ #define EISNAM 120 /* Is a named type file */