[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160614152952.05480c4a15aaf7973f302080@linux-foundation.org>
Date: Tue, 14 Jun 2016 15:29:52 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Ryusuke Konishi <konishi.ryusuke@....ntt.co.jp>
Cc: linux-nilfs <linux-nilfs@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/3] nilfs2: move ioctl interface and disk layout to
uapi separately
On Mon, 13 Jun 2016 22:45:07 +0900 Ryusuke Konishi <konishi.ryusuke@....ntt.co.jp> wrote:
> The header file "include/linux/nilfs2_fs.h" is composed of parts for
> ioctl and disk format, and both are intended to be shared with user
> space programs.
>
> This moves them to the uapi directory "include/uapi/linux" splitting
> the file to "nilfs2_api.h" and "nilfs2_ondisk.h". The following minor
> changes are accompanied by this migration:
>
> - nilfs_direct_node struct in nilfs2/direct.h is converged to
> nilfs2_ondisk.h because it's an on-disk structure.
> - inline functions nilfs_rec_len_from_disk() and
> nilfs_rec_len_to_disk() are moved to nilfs2/dir.c.
>
> ...
>
> +static inline __le16 nilfs_rec_len_to_disk(unsigned int len)
> +{
> +#if (PAGE_SIZE >= 65536)
> + if (len == (1 << 16))
> + return cpu_to_le16(NILFS_MAX_REC_LEN);
> +
> + BUG_ON(len > (1 << 16));
Is there any way in which the mount of a corrupted filesystem could
trigger this BUG? If so, that would be bad.
> +#endif
> + return cpu_to_le16(len);
> +}
Powered by blists - more mailing lists