Re: [PATCH 1/1] fs/fat: fix ENOSPC condition of directory entries.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"NODA, Kai" <nodakai@xxxxxxxxx> writes:

> From: "NODA, Kai" <nodakai@xxxxxxxxx>
>
> FAT_MAX_DIR_ENTRIES entries in a normal directory should be permitted as
> per the FAT spec.  Previously the max number of entries was
> FAT_MAX_DIR_ENTRIES - 1 due to the bug.
>
> Signed-off-by: NODA, Kai <nodakai@xxxxxxxxx>

Looks good.

Acked-by: OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx>

Thanks.

> ---
>  fs/fat/dir.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/fat/dir.c b/fs/fat/dir.c
> index 3963ede..cf9be44 100644
> --- a/fs/fat/dir.c
> +++ b/fs/fat/dir.c
> @@ -1288,7 +1288,7 @@ int fat_add_entries(struct inode *dir, void *slots, int nr_slots,
>  	err = -ENOSPC;
>  	while (fat_get_entry(dir, &pos, &bh, &de) > -1) {
>  		/* check the maximum size of directory */
> -		if (pos >= FAT_MAX_DIR_SIZE)
> +		if (pos > FAT_MAX_DIR_SIZE)
>  			goto error;
>  
>  		if (IS_FREE(de->name)) {

-- 
OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux