From mboxrd@z Thu Jan 1 00:00:00 1970 From: OGAWA Hirofumi Subject: Re: [PATCH 1/1] fs/fat: fix ENOSPC condition of directory entries. Date: Mon, 23 Dec 2013 20:05:37 +0900 Message-ID: <87d2knn7y6.fsf@devron.myhome.or.jp> References: <1387778129-6028-1-git-send-email-nodakai@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Cc: Andrew Morton , linux-fsdevel@vger.kernel.org To: "NODA\, Kai" Return-path: Received: from mail.parknet.co.jp ([210.171.160.6]:34608 "EHLO mail.parknet.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757043Ab3LWLFp (ORCPT ); Mon, 23 Dec 2013 06:05:45 -0500 In-Reply-To: <1387778129-6028-1-git-send-email-nodakai@gmail.com> (Kai NODA's message of "Mon, 23 Dec 2013 13:55:29 +0800") Sender: linux-fsdevel-owner@vger.kernel.org List-ID: "NODA, Kai" writes: > From: "NODA, Kai" > > 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 Looks good. Acked-by: OGAWA Hirofumi 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