Re: [PATCH] docs: filesystems: Fix a mundane typo

2021-03-18 Thread OGAWA Hirofumi
Bhaskar Chowdhury writes: > s/provisoned/provisioned/ > > Signed-off-by: Bhaskar Chowdhury Looks good. Acked-by: OGAWA Hirofumi > --- > Documentation/filesystems/vfat.rst | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/Documentation/f

Re: [PATCH] fs: fat: fix spelling typo of values

2021-03-02 Thread OGAWA Hirofumi
dingsen...@163.com writes: > From: dingsenjie > > vaules -> values > > Signed-off-by: dingsenjie Thanks. Acked-by: OGAWA Hirofumi > --- > fs/fat/fatent.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/fat/fatent.c b/fs/fat/

[PATCH v2] Fix zero_user_segments() with start > end

2021-02-28 Thread OGAWA Hirofumi
ON(). (we can fix __block_write_begin_int() instead though, it is the old and multiple usage) Also it calls kmap_atomic() unnecessary while start == end == 0. Fixes: 0060ef3b4e6d ("mm: support THPs in zero_user_segments") Cc: Signed-off-by: OGAWA Hirofumi --- mm/highmem.c | 17 ++

Re: [PATCH] Fix zero_user_segments() with start > end

2021-02-26 Thread OGAWA Hirofumi
Matthew Wilcox writes: > On Sat, Feb 27, 2021 at 01:11:35AM +0900, OGAWA Hirofumi wrote: >> zero_user_segments() is used from __block_write_begin_int(), for >> example like the following >> >> zero_user_segments(page, 4096, 1024, 512, 918) >> >>

[PATCH] Fix zero_user_segments() with start > end

2021-02-26 Thread OGAWA Hirofumi
ON(). (we can fix __block_write_begin_int() instead though, it is the old and multiple usage) Also it calls kmap_atomic() unnecessary while start == end == 0. Cc: Signed-off-by: OGAWA Hirofumi --- mm/highmem.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) di

Re: [PATCH v6] fat: Add KUnit tests for checksums and timestamps

2020-10-24 Thread OGAWA Hirofumi
ilds the FAT KUnit tests + + For more information on KUnit and unit tests in general, please refer + to the KUnit documentation in Documentation/dev-tools/kunit + + If unsure, say N _ -- OGAWA Hirofumi

Re: [PATCH v2] fat: Add KUnit tests for checksums and timestamps

2020-10-20 Thread OGAWA Hirofumi
hind an ifdef, I'll change it. OK. If nobody complain, let's export. However, then, can you add the comment instead of ifdef to mark for kunit? Thanks. -- OGAWA Hirofumi

Re: [PATCH v2] fat: Add KUnit tests for checksums and timestamps

2020-10-20 Thread OGAWA Hirofumi
at_time_unix2fat(struct msdos_sb_info *sbi, struct timespec64 *ts, -- OGAWA Hirofumi

Re: [PATCH] fat: Add KUnit tests for checksums and timestamps

2020-10-17 Thread OGAWA Hirofumi
ed by -- and serve a similar purpose to -- the > timestamp parsing KUnit tests in ext4[1]. > > [1]: > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/ext4/inode-test.c > > Signed-off-by: David Gow Looks good, thanks. Acked-by: OGAWA Hirofumi > --- &

Re: [PATCH] fat: Avoid oops when bdi->io_pages==0

2020-08-31 Thread OGAWA Hirofumi
it was for the page cache use case. The others > grew after that... FAT and pagecache usage would be similar or same purpose. The both is using io_pages as optimal IO size. In pagecache case, it uses io_pages if one request size is exceeding io_pages. In FAT case, there is perfect knowledge about future/total request size. So FAT divides request by io_pages, and adjust ra_pages with knowledge. I don't know about verity. Thanks. -- OGAWA Hirofumi

Re: [PATCH] fat: Avoid oops when bdi->io_pages==0

2020-08-31 Thread OGAWA Hirofumi
Jens Axboe writes: > On 8/31/20 10:37 AM, OGAWA Hirofumi wrote: >> Jens Axboe writes: >> >>> I don't think we should work-around this here. What device is this on? >>> Something like the below may help. >> >> The reported bug is from nvme stack, a

Re: [PATCH] fat: Avoid oops when bdi->io_pages==0

2020-08-31 Thread OGAWA Hirofumi
Jens Axboe writes: > On Sat, Aug 29, 2020 at 7:08 PM OGAWA Hirofumi > wrote: >> >> On one system, there was bdi->io_pages==0. This seems to be the bug of >> a driver somewhere, and should fix it though. Anyway, it is better to >> avoid the divide-

Re: [PATCH] fat: Avoid oops when bdi->io_pages==0

2020-08-30 Thread OGAWA Hirofumi
v4.19.142, > v4.14.195, v4.9.234, v4.4.234. > > v5.8.5: Build OK! [...] > > How should we proceed with this patch? Only 5.8.x has to apply this patch. Thanks. -- OGAWA Hirofumi

Re: [PATCH] fat: Avoid oops when bdi->io_pages==0

2020-08-30 Thread OGAWA Hirofumi
Matthew Wilcox writes: > On Sun, Aug 30, 2020 at 10:54:35AM +0900, OGAWA Hirofumi wrote: >> Matthew Wilcox writes: >> >> Hm, io_pages is limited by driver setting too, and io_pages can be lower >> than ra_pages, e.g. usb storage. >> >> Assuming ra_pages

Re: [PATCH] fat: Avoid oops when bdi->io_pages==0

2020-08-29 Thread OGAWA Hirofumi
Matthew Wilcox writes: > On Sun, Aug 30, 2020 at 09:59:41AM +0900, OGAWA Hirofumi wrote: >> On one system, there was bdi->io_pages==0. This seems to be the bug of >> a driver somewhere, and should fix it though. Anyway, it is better to >> avoid the divide-by-zero Oo

[PATCH] fat: Avoid oops when bdi->io_pages==0

2020-08-29 Thread OGAWA Hirofumi
On one system, there was bdi->io_pages==0. This seems to be the bug of a driver somewhere, and should fix it though. Anyway, it is better to avoid the divide-by-zero Oops. So this check it. Signed-off-by: OGAWA Hirofumi Cc: --- fs/fat/fatent.c |2 +- 1 file changed, 1 insertion(+)

[PATCH] block: Set default value to bdi->io_pages instead of zero

2020-08-29 Thread OGAWA Hirofumi
This may not enough to guarantee ->io_pages is not zero though, instead of leaving ->io_pages as zero, this initializing ->io_pages to sane value. (maybe some part of NVMe driver seems to be) Signed-off-by: OGAWA Hirofumi --- block/blk-core.c |1 + 1 file changed, 1 insertion(+) d

[PATCH] fat: Fix fat_ra_init() for data clusters == 0

2020-07-11 Thread OGAWA Hirofumi
If data clusters == 0, fat_ra_init() calls the ->ent_blocknr() for the cluster beyond ->max_clusters. This checks the limit before initialization to suppress the warning. Reported-by: syzbot+756199124937b31a9...@syzkaller.appspotmail.com Signed-off-by: OGAWA Hirofumi --- fs/fat/fatent.c

Re: [PATCH] VFAT/FAT/MSDOS FILESYSTEM: Replace HTTP links with HTTPS ones

2020-07-08 Thread OGAWA Hirofumi
eplace HTTP with HTTPS. > > Signed-off-by: Alexander A. Klimov Acked-by: OGAWA Hirofumi > --- > Continuing my work started at 93431e0607e5. > See also: git log --oneline '--author=Alexander A. Klimov > ' v5.7..master > (Actually letting a shell for loop submit all this stuff

Re: [PATCH] fs: fat: add check for dir size in fat_calc_dir_size

2020-07-06 Thread OGAWA Hirofumi
umber of files/directories, of > corrupted dir(\CorruptedDIR) without delay. It may had the luck, loop was filtered by invalid names. Well, not sure. -- OGAWA Hirofumi

Re: [PATCH] fs: fat: add check for dir size in fat_calc_dir_size

2020-07-03 Thread OGAWA Hirofumi
ndows 10 PC, > 2623 directory entries were listed and timestamps were wrong What happens if you recursively traversed directories on Windows? This issue happens on Windows too? Thanks. -- OGAWA Hirofumi

Re: (2) [PATCH] fs: fat: add check for dir size in fat_calc_dir_size

2020-06-30 Thread OGAWA Hirofumi
t of applying this to the mainline, as our FAT is aligned with main > kernel. So what was the root cause of slowness on big directory? Thanks. -- OGAWA Hirofumi

Re: [PATCH] fs: fat: add check for dir size in fat_calc_dir_size

2020-06-30 Thread OGAWA Hirofumi
irectory (invalid size %lld)\n", > + __func__, i_size_read(inode)); > + return -EIO; > + } > + > return 0; > } -- OGAWA Hirofumi

Re: [PATCH] fatfs: switch write_lock to read_lock in fat_ioctl_get_attributes

2020-06-30 Thread OGAWA Hirofumi
fengyubo writes: > From: Yubo Feng > > There is no necessery to hold write_lock in fat_ioctl_get_attributes. > write_lock may make an impact on concurrency of fat_ioctl_get_attributes. > > Signed-off-by: Yubo Feng Looks good. Acked-by: OGAWA Hirofumi > --- > fs/

Re: [PATCH] fat: add a check to fat_add_new_entries

2020-06-21 Thread OGAWA Hirofumi
err = -ENOMEM; > + goto error_nomem; > + } > + The cluster is 28bits and sec_per_clus is 8bits, so this should never overflow actually. Is there no way to tell it to clang? Thanks. -- OGAWA Hirofumi

Re: [PATCH] drivers/staging/exfat - by default, prohibit mount of fat/vfat

2019-09-08 Thread OGAWA Hirofumi
driver basically, however on other hand, it is better to share the code for same on-disk format if possible. Anyway, I don't have strong opinion about it. Thanks. -- OGAWA Hirofumi

Re: [PATCH] fat: Delete an unnecessary check before brelse()

2019-09-08 Thread OGAWA Hirofumi
the Coccinelle software. > > Signed-off-by: Markus Elfring Acked-by: OGAWA Hirofumi Thanks. > --- > fs/fat/dir.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/fs/fat/dir.c b/fs/fat/dir.c > index 1bda2ab6745b..f4bc87a3c98d 100644 > --- a/fs/fat/di

Re: [PATCH] fat: fix corruption in fat_alloc_new_dir()

2019-09-08 Thread OGAWA Hirofumi
lose(loop_fd); > unlink(testfile); > > if (ret) > break; > } > > return 0; > } > > Issue triggers within minute on HPE Apollo 70 (arm64, 64GB RAM, 224 CPUs). Using the device while mounting same device doesn't work reliably like this race. (getblk() is intentionally used to get the buffer to write new data.) mount(2) internally opens the device by EXCL mode, so I guess udev opens without EXCL (I dont know if it is intent or not). Thanks. -- OGAWA Hirofumi

Re: [ANNOUNCE] Three things.

2019-09-02 Thread OGAWA Hirofumi
ithub.com/OGAWAHirofumi/linux-tux3/tree/hirofumi-user Thanks. -- OGAWA Hirofumi

Re: [PATCH 12/20] fs: fat: Initialize filesystem timestamp ranges

2019-07-30 Thread OGAWA Hirofumi
FAT_TIME_MAX), > cpu_to_le16(FAT_DATE_MAX), 0); > sb->s_time_max = ts.tv_sec; > > > } > > I do not see what the problem is. Ouch, you are right. I was reading that patch wrongly, sorry. Thanks. -- OGAWA Hirofumi

Re: [PATCH 12/20] fs: fat: Initialize filesystem timestamp ranges

2019-07-30 Thread OGAWA Hirofumi
v_sec; At least, it is wrong to call fat_time_fat2unix() before setup parameters in sbi. And please move those timestamp stuff to fat/misc.c like other fat timestamp helpers. (Maybe, provide fat_time_{min,max}() from fat/misc.c, or fat_init_time() such?). Thanks. -- OGAWA Hirofumi

Re: [PATCH] fat: Add nobarrier to workaround the strange behavior of device

2019-06-28 Thread OGAWA Hirofumi
Christoph Hellwig writes: > On Sat, Jun 29, 2019 at 12:03:46AM +0900, OGAWA Hirofumi wrote: >> I see, sounds like good though. Does it work for all stable versions? >> Can it disable only flush command without other effect? And it would be >> better to be normal use

Re: [PATCH] fat: Add nobarrier to workaround the strange behavior of device

2019-06-28 Thread OGAWA Hirofumi
Christoph Hellwig writes: > On Fri, Jun 28, 2019 at 11:18:19PM +0900, OGAWA Hirofumi wrote: >> To workaround those devices and provide flexibility, this adds >> "barrier"/"nobarrier" mount options to fat driver. > > We have deprecated these rathe

[PATCH v2] fat: Add nobarrier to workaround the strange behavior of device

2019-06-28 Thread OGAWA Hirofumi
d provide flexibility, this adds "barrier"/"nobarrier" mount options to fat driver. Cc: Signed-off-by: OGAWA Hirofumi --- fs/fat/fat.h |1 + fs/fat/file.c |8 ++-- fs/fat/inode.c | 22 +- 3 files changed, 24 insertions(+), 7 deletions(-)

[PATCH] fat: Add nobarrier to workaround the strange behavior of device

2019-06-28 Thread OGAWA Hirofumi
. (it returns NOT_READY [MEDIUM NOT PRESENT] for SENSE command, and this happened on Kindle) [just a guess, the device is trying to detect the "safe-unplug" operation of Windows or such?] To workaround those devices and provide flexibility, this adds "barrier"/"nobarri

Re: [PATCH] fat: issue flush after the writeback of FAT

2019-04-08 Thread OGAWA Hirofumi
k of FAT instead before. > > Also bail out early when any stage of fsync fails. > > Signed-off-by: Hou Tao Looks good. Acked-by: OGAWA Hirofumi > --- > fs/fat/file.c | 11 --- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/fs/fat/file.c b/fs/fa

Re: [PATCH] fat: issue flush after the writeback of FAT

2019-04-08 Thread OGAWA Hirofumi
ode->i_sb)->fat_inode->i_mapping); > > Huh. I would've thought that flushing the FAT would also be required > at the end of a WB_SYNC_ALL (aka data integrity) writepages call? In fatfs implement, FAT area is flushed by sync_mapping_buffers(fat_inode). (FAT buffer is dirtie

Re: [PATCH v3] vfat: don't read garbage after last dirent

2019-02-13 Thread OGAWA Hirofumi
rt(struct inode *dir, int i_logstart, > sinfo->slot_off = 0; > sinfo->bh = NULL; > while (fat_get_short_entry(dir, >slot_off, >bh, > ->de) >= 0) { > +>de) >= 0 && sinfo->de->name[0]) { > if (fat_get_start(MSDOS_SB(sb), sinfo->de) == i_logstart) { > sinfo->slot_off -= sizeof(*sinfo->de); > sinfo->nr_slots = 1; -- OGAWA Hirofumi

Re: [PATCH] fat: enable .splice_write to support splice on O_DIRECT file

2019-02-13 Thread OGAWA Hirofumi
OGAWA Hirofumi writes: > Hou Tao writes: > >> Now splice() on O_DIRECT-opened fat file will return -EFAULT, that is >> because the default .splice_write, namely default_file_splice_write(), >> will construct an ITER_KVEC iov_iter and dio_refill_pages() in di

Re: [PATCH] fat: enable .splice_write to support splice on O_DIRECT file

2019-02-13 Thread OGAWA Hirofumi
e, > .fallocate = fat_fallocate, > }; Looks good. Acked-by: OGAWA Hirofumi Thanks. -- OGAWA Hirofumi

Re: [PATCH v2] vfat: don't read garbage after last dirent

2018-12-24 Thread OGAWA Hirofumi
maining. Please check more. For example, looks like fat_parse_long()/fat_search_long() path is missing, and fat_get_dotdot_entry(), fat_subdirs() too. (while adding new entry, if we found zeroed entry, we would be better to warn about fsck.) Thanks. -- OGAWA Hirofumi

Re: [PATCH v3 0/3] fat: Added functions to determine the FAT variant (12/16/32bit)

2018-12-24 Thread OGAWA Hirofumi
26 +++--- > fs/fat/misc.c | 2 +- > include/uapi/linux/msdos_fs.h | 5 - > 7 files changed, 55 insertions(+), 30 deletions(-) FWIW, Acked-by: OGAWA Hirofumi for all of this patchset. Thanks. -- OGAWA Hirofumi

Re: [PATCH v2 3/3] fat: New inline functions to determine the FAT variant (32, 16 or 12)

2018-12-15 Thread OGAWA Hirofumi
fat_fill_super(struct super_block *sb, void > *data, int silent, int isvfat, > > total_clusters = (total_sectors - sbi->data_start) / sbi->sec_per_clus; > > - if (sbi->fat_bits != 32) > + if (!IS_FAT32(sbi)) > sbi->fat_bits = (total_clusters > MAX_FAT12) ? 16 : 12; > > /* some OSes set FAT_STATE_DIRTY and clean it on unmount. */ > - if (sbi->fat_bits == 32) > + if (IS_FAT32(sbi)) > sbi->dirty = bpb.fat32_state & FAT_STATE_DIRTY; > else /* fat 16 or 12 */ > sbi->dirty = bpb.fat16_state & FAT_STATE_DIRTY; > diff --git a/fs/fat/misc.c b/fs/fat/misc.c > index fce0a76..5368c6a 100644 > --- a/fs/fat/misc.c > +++ b/fs/fat/misc.c > @@ -64,7 +64,7 @@ int fat_clusters_flush(struct super_block *sb) > struct buffer_head *bh; > struct fat_boot_fsinfo *fsinfo; > > - if (sbi->fat_bits != 32) > + if (!IS_FAT32(sbi)) > return 0; > > bh = sb_bread(sb, sbi->fsinfo_sector); -- OGAWA Hirofumi

Re: [PATCH v2 2/3] fat: Moved MAX_FAT to fat.h and changed it to inline function

2018-12-15 Thread OGAWA Hirofumi
.a577389 100644 > --- a/include/uapi/linux/msdos_fs.h > +++ b/include/uapi/linux/msdos_fs.h > @@ -65,8 +65,6 @@ > #define MAX_FAT120xFF4 > #define MAX_FAT160xFFF4 > #define MAX_FAT320x0FF6 > -#define MAX_FAT(s) (MSDOS_SB(s)->fat_bits == 32 ? MAX_FAT32 : \ > - MSDOS_SB(s)->fat_bits == 16 ? MAX_FAT16 : MAX_FAT12) > > /* bad cluster mark */ > #define BAD_FAT120xFF7 -- OGAWA Hirofumi

Re: [PATCH 2/2] fat: New macros to determine the FAT variant (32, 16 or 12)

2018-12-14 Thread OGAWA Hirofumi
o, now FAT_FIRST_ENT() is pointed only from comment. The reason is only for this comment. Thanks. -- OGAWA Hirofumi

Re: [PATCH] vfat: don't read garbage after last dirent

2018-12-13 Thread OGAWA Hirofumi
entry(inode, , , ) == -1) > + if (fat_get_entry(inode, , , ) == -1 || !de->name[0]) > goto end_of_dir; > parse_record: > nr_slots = 0; Thanks. -- OGAWA Hirofumi

Re: [PATCH 2/2] fat: New macros to determine the FAT variant (32, 16 or 12)

2018-12-13 Thread OGAWA Hirofumi
sbi->fat_bits == 16) >> +#define IS_FAT32(sbi) (sbi->fat_bits == 32) > > sbi should be parenthesized or perhaps better these should be > static inline bool functions Right, rather this is the bug (not hit yet though) that should be fixed. Thanks. -- OGAWA Hirofumi

Re: [PATCH] fat: Replaced 11 magic to MSDOS_NAME for volume label

2018-11-26 Thread OGAWA Hirofumi
earch for 'if (memcmp(label, NO_NAME, MSDOS_NAME))'. > I consider to make the same patch there as well. > https://github.com/dosfstools/dosfstools/blob/master/src/mkfs.fat.c > > Signed-off-by: Carmeli Tamir Reviewed-by: Johannes Thumshirn Reviewed-by: Sergey Senozhatsky Acked-by: OGAWA

Re: [PATCH] fat: Replaced 11 magic to MSDOS_NAME for volume label

2018-11-26 Thread OGAWA Hirofumi
earch for 'if (memcmp(label, NO_NAME, MSDOS_NAME))'. > I consider to make the same patch there as well. > https://github.com/dosfstools/dosfstools/blob/master/src/mkfs.fat.c > > Signed-off-by: Carmeli Tamir Reviewed-by: Johannes Thumshirn Reviewed-by: Sergey Senozhatsky Acked-by: OGAWA

Re: [PATCH] fs/fat: add cond_resched to fat_count_free_clusters

2018-10-11 Thread OGAWA Hirofumi
ree++; > } while (fat_ent_next(sbi, )); > + cond_resched(); > } > sbi->free_clusters = free; > sbi->free_clus_valid = 1; Acked-by: OGAWA Hirofumi Thanks, looks good. -- OGAWA Hirofumi

Re: [PATCH] fs/fat: add cond_resched to fat_count_free_clusters

2018-10-11 Thread OGAWA Hirofumi
ree++; > } while (fat_ent_next(sbi, )); > + cond_resched(); > } > sbi->free_clusters = free; > sbi->free_clus_valid = 1; Acked-by: OGAWA Hirofumi Thanks, looks good. -- OGAWA Hirofumi

Re: [PATCH] fat: Expand a slightly out-of-date comment

2018-09-29 Thread OGAWA Hirofumi
ork)); > - /* see namei.c, msdos_format_name */ > + /* For an explanation of the special treatment of 0x05 in > + * filenames, see msdos_format_name in namei_msdos.c > + */ > if (work[0] == 0x05) > work[0] = 0xE5; Acked-by: OGAWA Hirofumi Thanks. -- OGAWA Hirofumi

Re: [PATCH] fat: Expand a slightly out-of-date comment

2018-09-29 Thread OGAWA Hirofumi
ork)); > - /* see namei.c, msdos_format_name */ > + /* For an explanation of the special treatment of 0x05 in > + * filenames, see msdos_format_name in namei_msdos.c > + */ > if (work[0] == 0x05) > work[0] = 0xE5; Acked-by: OGAWA Hirofumi Thanks. -- OGAWA Hirofumi

Re: [PATCH] fat: Expand a slightly out-of-date comment

2018-09-28 Thread OGAWA Hirofumi
ork)); > - /* see namei.c, msdos_format_name */ > + /* For an explanation of the special treatment of 0x05 in > +filenames, see msdos_format_name in namei_msdos.c */ > if (work[0] == 0x05) > work[0] = 0xE5; Sorry. However, could you use /* *

Re: [PATCH] fat: Expand a slightly out-of-date comment

2018-09-28 Thread OGAWA Hirofumi
ork)); > - /* see namei.c, msdos_format_name */ > + /* For an explanation of the special treatment of 0x05 in > +filenames, see msdos_format_name in namei_msdos.c */ > if (work[0] == 0x05) > work[0] = 0xE5; Sorry. However, could you use /* *

Re: [PATCH] fat: Relax checks for sector size and media type

2018-09-12 Thread OGAWA Hirofumi
ting FAT sector_size >= 8192. After that, it would be safe to remove 4096 limitation. Thanks. -- OGAWA Hirofumi

Re: [PATCH] fat: Relax checks for sector size and media type

2018-09-12 Thread OGAWA Hirofumi
ting FAT sector_size >= 8192. After that, it would be safe to remove 4096 limitation. Thanks. -- OGAWA Hirofumi

Re: [PATCH] fat: Relax checks for sector size and media type

2018-09-03 Thread OGAWA Hirofumi
wever, FAT would be for exchange data with other devices, and there is "cluster per sector", and spec recommends sector size == device sector size. So I suspect this format is not useful. Thanks. -- OGAWA Hirofumi

Re: [PATCH] fat: Relax checks for sector size and media type

2018-09-03 Thread OGAWA Hirofumi
wever, FAT would be for exchange data with other devices, and there is "cluster per sector", and spec recommends sector size == device sector size. So I suspect this format is not useful. Thanks. -- OGAWA Hirofumi

Re: [PATCH] fat: Relax checks for sector size and media type

2018-09-03 Thread OGAWA Hirofumi
t;= 4096. Rather why do you want to support larger than 4096? Or I'm missing something? > 2) Is check in fat driver really needed (if block layer checks it)? Yes, isolating block layer error and fat format error to be better error report. -- OGAWA Hirofumi

Re: [PATCH] fat: Relax checks for sector size and media type

2018-09-03 Thread OGAWA Hirofumi
t;= 4096. Rather why do you want to support larger than 4096? Or I'm missing something? > 2) Is check in fat driver really needed (if block layer checks it)? Yes, isolating block layer error and fat format error to be better error report. -- OGAWA Hirofumi

Re: [PATCH] fat: Relax checks for sector size and media type

2018-09-03 Thread OGAWA Hirofumi
_LINUX_MSDOS_FS_H */ This is ok though, this would be for ancient floppy media. Thanks. -- OGAWA Hirofumi

Re: [PATCH] fat: Relax checks for sector size and media type

2018-09-03 Thread OGAWA Hirofumi
_LINUX_MSDOS_FS_H */ This is ok though, this would be for ancient floppy media. Thanks. -- OGAWA Hirofumi

Re: [PATCH] Cleanup "fat: propagate 64-bit inode timestamps" patch

2018-08-20 Thread OGAWA Hirofumi
uld have been 'u16', > which saves a few bytes. Right. However, "long long" on 32bit arch is not same. In this implement "long long" works though, Some calculation needs libgcc helper (in kernel, div64 stuff). I want to avoid it early than later, and I don't care saving a few memory in here (I would not care if it was u16). Thanks. -- OGAWA Hirofumi

Re: [PATCH] Cleanup "fat: propagate 64-bit inode timestamps" patch

2018-08-20 Thread OGAWA Hirofumi
uld have been 'u16', > which saves a few bytes. Right. However, "long long" on 32bit arch is not same. In this implement "long long" works though, Some calculation needs libgcc helper (in kernel, div64 stuff). I want to avoid it early than later, and I don't care saving a few memory in here (I would not care if it was u16). Thanks. -- OGAWA Hirofumi

[PATCH] Cleanup "fat: propagate 64-bit inode timestamps" patch

2018-08-17 Thread OGAWA Hirofumi
Hi, Looks like I missed the email to read for a patch (mmots/broken-out/fat-propagate-64-bit-inode-timestamps.patch). Well, so FWIW, Acked-by: OGAWA Hirofumi And additionally cleanup patch here (this would be better to be folded into his patch). Thanks. -- OGAWA Hirofumi [PATCH] Cleanup

[PATCH] Cleanup "fat: propagate 64-bit inode timestamps" patch

2018-08-17 Thread OGAWA Hirofumi
Hi, Looks like I missed the email to read for a patch (mmots/broken-out/fat-propagate-64-bit-inode-timestamps.patch). Well, so FWIW, Acked-by: OGAWA Hirofumi And additionally cleanup patch here (this would be better to be folded into his patch). Thanks. -- OGAWA Hirofumi [PATCH] Cleanup

[PATCH] fat: Support timespec64 for 2107

2018-08-13 Thread OGAWA Hirofumi
On disk format of FAT is supporting until the end of 2107 year. So this uses timespec64 internally without any truncation (until 2107). Signed-off-by: OGAWA Hirofumi --- fs/fat/dir.c |2 +- fs/fat/fat.h |6 +++--- fs/fat/inode.c | 20 ++-- fs/fat

[PATCH] fat: Support timespec64 for 2107

2018-08-13 Thread OGAWA Hirofumi
On disk format of FAT is supporting until the end of 2107 year. So this uses timespec64 internally without any truncation (until 2107). Signed-off-by: OGAWA Hirofumi --- fs/fat/dir.c |2 +- fs/fat/fat.h |6 +++--- fs/fat/inode.c | 20 ++-- fs/fat

Re: FAT: Operating on broken FAT FS causes the write syscall to return negative number not equal to -1

2018-07-15 Thread OGAWA Hirofumi
ach memory load). And to verify this invalid shared data blocks, we will have to read all inodes (i.e. almost fsck). So, I may change the code if data verification is easy and lightweight like in this case. But like said above, it will not be guaranteed. Thanks. -- OGAWA Hirofumi

Re: FAT: Operating on broken FAT FS causes the write syscall to return negative number not equal to -1

2018-07-15 Thread OGAWA Hirofumi
ach memory load). And to verify this invalid shared data blocks, we will have to read all inodes (i.e. almost fsck). So, I may change the code if data verification is easy and lightweight like in this case. But like said above, it will not be guaranteed. Thanks. -- OGAWA Hirofumi

[PATCH v2] Re: FAT: Operating on broken FAT FS causes the write syscall to return negative number not equal to -1

2018-07-15 Thread OGAWA Hirofumi
Al Viro writes: > On Sun, Jul 15, 2018 at 11:20:06PM +0900, OGAWA Hirofumi wrote: >> +static inline bool fat_valid_entry(struct msdos_sb_info *sbi, int entry) >> +{ >> +if (entry < FAT_START_ENT || sbi->max_cluster <= entry) >> +return false

[PATCH v2] Re: FAT: Operating on broken FAT FS causes the write syscall to return negative number not equal to -1

2018-07-15 Thread OGAWA Hirofumi
Al Viro writes: > On Sun, Jul 15, 2018 at 11:20:06PM +0900, OGAWA Hirofumi wrote: >> +static inline bool fat_valid_entry(struct msdos_sb_info *sbi, int entry) >> +{ >> +if (entry < FAT_START_ENT || sbi->max_cluster <= entry) >> +return false

Re: FAT: Operating on broken FAT FS causes the write syscall to return negative number not equal to -1

2018-07-15 Thread OGAWA Hirofumi
have invalid ->i_start. To handle it, this checks ->i_start before using, and return proper error code. Signed-off-by: OGAWA Hirofumi --- fs/fat/cache.c | 19 --- fs/fat/fat.h|7 +++ fs/fat/fatent.c |6 +++--- 3 files changed, 22 insertions(+), 10 deletions(-) diff -

Re: FAT: Operating on broken FAT FS causes the write syscall to return negative number not equal to -1

2018-07-15 Thread OGAWA Hirofumi
have invalid ->i_start. To handle it, this checks ->i_start before using, and return proper error code. Signed-off-by: OGAWA Hirofumi --- fs/fat/cache.c | 19 --- fs/fat/fat.h|7 +++ fs/fat/fatent.c |6 +++--- 3 files changed, 22 insertions(+), 10 deletions(-) diff -

[PATCH] fat: Fix potential shift wrap with FITRIM ioctl on FAT

2018-07-13 Thread OGAWA Hirofumi
a problem on a larger than 4GB partition with FAT32. Though most tools who call this ioctl would ignore this value, it would be great to fix it. Signed-off-by: Wentao Wang Signed-off-by: OGAWA Hirofumi --- fs/fat/fatent.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -puN fs/fat/fa

[PATCH] fat: Fix potential shift wrap with FITRIM ioctl on FAT

2018-07-13 Thread OGAWA Hirofumi
a problem on a larger than 4GB partition with FAT32. Though most tools who call this ioctl would ignore this value, it would be great to fix it. Signed-off-by: Wentao Wang Signed-off-by: OGAWA Hirofumi --- fs/fat/fatent.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -puN fs/fat/fa

[PATCH] fat: Fix memory allocation failure handling of match_strdup()

2018-07-12 Thread OGAWA Hirofumi
e88228...@syzkaller.appspotmail.com Cc: Signed-off-by: OGAWA Hirofumi --- fs/fat/inode.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff -puN fs/fat/inode.c~fat-fix-kmalloc-failure fs/fat/inode.c --- linux/fs/fat/inode.c~fat-fix-kmalloc-failure2018-07-12

[PATCH] fat: Fix memory allocation failure handling of match_strdup()

2018-07-12 Thread OGAWA Hirofumi
e88228...@syzkaller.appspotmail.com Cc: Signed-off-by: OGAWA Hirofumi --- fs/fat/inode.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff -puN fs/fat/inode.c~fat-fix-kmalloc-failure fs/fat/inode.c --- linux/fs/fat/inode.c~fat-fix-kmalloc-failure2018-07-12

[PATCH] fat: Add FITRIM ioctl for FAT file system

2018-07-02 Thread OGAWA Hirofumi
From: Wentao Wang Add FITRIM ioctl for FAT file system [hirof...@mail.parknet.co.jp: bug fixes, coding style fixes, add signal check] Signed-off-by: Wentao Wang Signed-off-by: OGAWA Hirofumi --- fs/fat/fat.h|1 fs/fat/fatent.c | 102

[PATCH] fat: Add FITRIM ioctl for FAT file system

2018-07-02 Thread OGAWA Hirofumi
From: Wentao Wang Add FITRIM ioctl for FAT file system [hirof...@mail.parknet.co.jp: bug fixes, coding style fixes, add signal check] Signed-off-by: Wentao Wang Signed-off-by: OGAWA Hirofumi --- fs/fat/fat.h|1 fs/fat/fatent.c | 102

Re: PROBLEM: [kernel BUG at fs/fat/inode.c:162] when writing to a broken VFAT

2018-06-02 Thread OGAWA Hirofumi
Anatoly Trosinenko writes: > Description: > > Writing to some file on a broken VFAT partition causes kernel bug Thanks. This patch should fix this issue. -- OGAWA Hirofumi [PATCH] fat: Use fat_fs_error() instead of BUG_ON() in __fat_get_block() If file size and FAT clus

Re: PROBLEM: [kernel BUG at fs/fat/inode.c:162] when writing to a broken VFAT

2018-06-02 Thread OGAWA Hirofumi
Anatoly Trosinenko writes: > Description: > > Writing to some file on a broken VFAT partition causes kernel bug Thanks. This patch should fix this issue. -- OGAWA Hirofumi [PATCH] fat: Use fat_fs_error() instead of BUG_ON() in __fat_get_block() If file size and FAT clus

Re: [PATCH 3/3] fs: fat: add ioctl method in fat filesystem driver

2018-01-30 Thread OGAWA Hirofumi
chenchacha <chen.chencha...@foxmail.com> writes: > On 01/29/2018 09:02 PM, OGAWA Hirofumi wrote: >> ChenGuanqiao <chen.chencha...@foxmail.com> writes: >> >>> +static int fat_check_d_characters(char *label, unsigned long len) >>> +{ >>

Re: [PATCH 3/3] fs: fat: add ioctl method in fat filesystem driver

2018-01-30 Thread OGAWA Hirofumi
chenchacha writes: > On 01/29/2018 09:02 PM, OGAWA Hirofumi wrote: >> ChenGuanqiao writes: >> >>> +static int fat_check_d_characters(char *label, unsigned long len) >>> +{ >>> + int i; >>> + >>> + for (i = 0; i < len;

Re: [PATCH 3/3] fs: fat: add ioctl method in fat filesystem driver

2018-01-29 Thread OGAWA Hirofumi
memcpy(b->fat32.vol_label, label, sizeof(label)); > + else > + memcpy(b->fat16.vol_label, label, sizeof(label)); > + > + mark_buffer_dirty(boot_bh); > + > + /* Synchronize the data together */ > + err = sync_dirty_buffer(boot_bh); > + if (err) > + goto out_boot_brelse; -- OGAWA Hirofumi <hirof...@mail.parknet.co.jp>

Re: [PATCH 3/3] fs: fat: add ioctl method in fat filesystem driver

2018-01-29 Thread OGAWA Hirofumi
abel)); > + else > + memcpy(b->fat16.vol_label, label, sizeof(label)); > + > + mark_buffer_dirty(boot_bh); > + > + /* Synchronize the data together */ > + err = sync_dirty_buffer(boot_bh); > + if (err) > + goto out_boot_brelse; -- OGAWA Hirofumi

Re: [PATCH v7 1/3] fs: fat: Add fat filesystem partition volume label in local structure

2018-01-14 Thread OGAWA Hirofumi
ck */ > int dir_per_block_bits; /* log2(dir_per_block) */ > unsigned int vol_id;/*volume ID*/ > + char vol_label[11]; /*volume label*/ In latter patches doesn't use this cache. Why do we cache, or why read ioctl doesn't use this cache? -- OGAWA Hirofumi <hirof...@mail.parknet.co.jp>

Re: [PATCH v7 1/3] fs: fat: Add fat filesystem partition volume label in local structure

2018-01-14 Thread OGAWA Hirofumi
_per_block) */ > unsigned int vol_id;/*volume ID*/ > + char vol_label[11]; /*volume label*/ In latter patches doesn't use this cache. Why do we cache, or why read ioctl doesn't use this cache? -- OGAWA Hirofumi

Re: [PATCH v7 3/3] fs: fat: add ioctl method in fat filesystem driver

2018-01-14 Thread OGAWA Hirofumi
TW, lock order is tested with LOCKDEP? > + /* Synchronize the data together */ > + err = sync_dirty_buffer(boot_bh); > + if (err) > + goto out_boot_brelse; > + err = sync_dirty_buffer(vol_bh); > + if (err) > + goto out_boot_brelse; Probably, we don't need to sync vol_bh. And in the case of adding new entry, now already doesn't sync. -- OGAWA Hirofumi <hirof...@mail.parknet.co.jp>

Re: [PATCH v7 3/3] fs: fat: add ioctl method in fat filesystem driver

2018-01-14 Thread OGAWA Hirofumi
ed with LOCKDEP? > + /* Synchronize the data together */ > + err = sync_dirty_buffer(boot_bh); > + if (err) > + goto out_boot_brelse; > + err = sync_dirty_buffer(vol_bh); > + if (err) > + goto out_boot_brelse; Probably, we don't need to sync vol_bh. And in the case of adding new entry, now already doesn't sync. -- OGAWA Hirofumi

Re: [PATCH v7 2/3] fs: fat: Add volume label entry method function

2018-01-14 Thread OGAWA Hirofumi
tr = ATTR_VOLUME; > + de.lcase = 0; > + fat_time_unix2fat(sbi, ts, , , NULL); > + de.cdate = de.adate = 0; > + de.ctime = 0; > + de.ctime_cs = 0; > + de.time = time; > + de.date = date; > + fat_set_start(, 0); > + de.size = 0; > + >

Re: [PATCH v7 2/3] fs: fat: Add volume label entry method function

2018-01-14 Thread OGAWA Hirofumi
unix2fat(sbi, ts, , , NULL); > + de.cdate = de.adate = 0; > + de.ctime = 0; > + de.ctime_cs = 0; > + de.time = time; > + de.date = date; > + fat_set_start(, 0); > + de.size = 0; > + > + err = fat_add_entries(dir, , 1, ); > + if (err) > + return err; > + > + brelse(sinfo.bh); > + > + return 0; > +} > +EXPORT_SYMBOL_GPL(fat_add_volume_label_entry); -- OGAWA Hirofumi

Re: [PATCH v6 3/3] fs: fat: add ioctl method in fat filesystem driver

2018-01-09 Thread OGAWA Hirofumi
"); > + err = -EIO; > + goto out_boot_brelse; > + } > + > + b = (struct fat_boot_sector *)boot_bh->b_data; > + lock_buffer(boot_bh); No need lock_buffer()? > + if (sbi->fat_bits == 32) > + memcpy(b->fat32.vol_label, label, sizeof(label)); > + else > + memcpy(b->fat16.vol_label, label, sizeof(label)); > + > + mark_buffer_dirty(boot_bh); > + unlock_buffer(boot_bh); -- OGAWA Hirofumi <hirof...@mail.parknet.co.jp>

Re: [PATCH v6 3/3] fs: fat: add ioctl method in fat filesystem driver

2018-01-09 Thread OGAWA Hirofumi
ruct fat_boot_sector *)boot_bh->b_data; > + lock_buffer(boot_bh); No need lock_buffer()? > + if (sbi->fat_bits == 32) > + memcpy(b->fat32.vol_label, label, sizeof(label)); > + else > + memcpy(b->fat16.vol_label, label, sizeof(label)); > + > + mark_buffer_dirty(boot_bh); > + unlock_buffer(boot_bh); -- OGAWA Hirofumi

Re: [PATCH v6 2/3] fs: fat: Add volume label entry method function

2018-01-08 Thread OGAWA Hirofumi
de.ctime_cs = 0; > + de.time = time; > + de.date = date; > + fat_set_start(, 0); > + de.size = 0; > + > + err = fat_add_entries(dir, , 1, ); > + if (err) > + return err; Missing call of brelse(sinfo.bh) > + dir->i_ctime = dir->i_mtime = *ts; Probably, we should not update this for labal. > + return fat_sync_inode(dir); No inode for root. -- OGAWA Hirofumi <hirof...@mail.parknet.co.jp>

Re: [PATCH v6 2/3] fs: fat: Add volume label entry method function

2018-01-08 Thread OGAWA Hirofumi
me = time; > + de.date = date; > + fat_set_start(, 0); > + de.size = 0; > + > + err = fat_add_entries(dir, , 1, ); > + if (err) > + return err; Missing call of brelse(sinfo.bh) > + dir->i_ctime = dir->i_mtime = *ts; Probably, we should not update this for labal. > + return fat_sync_inode(dir); No inode for root. -- OGAWA Hirofumi

Re: [PATCH v5 2/2] fs: fat: add ioctl method in fat filesystem driver

2017-12-27 Thread OGAWA Hirofumi
s root directory's vol_label */ > + err = fat_scan_volume_label(inode, ); > + if (err) > + goto out_drop_file; It should add entry if no volume label. > + lock_buffer(bh); inode write lock. > + memcpy(sinfo.de->name, label, sizeof(sinfo.de->name)); > + mark_buffer_dirty(bh); > + unlock_buffer(bh); Thanks. -- OGAWA Hirofumi <hirof...@mail.parknet.co.jp>

Re: [PATCH v5 2/2] fs: fat: add ioctl method in fat filesystem driver

2017-12-27 Thread OGAWA Hirofumi
el(inode, ); > + if (err) > + goto out_drop_file; It should add entry if no volume label. > + lock_buffer(bh); inode write lock. > + memcpy(sinfo.de->name, label, sizeof(sinfo.de->name)); > + mark_buffer_dirty(bh); > + unlock_buffer(bh); Thanks. -- OGAWA Hirofumi

Re: [PATCH v5 1/2] fs: fat: Add fat filesystem partition volume label in local structure

2017-12-27 Thread OGAWA Hirofumi
sinfo->de); > + sinfo->nr_slots = 1; > + sinfo->i_pos = fat_make_i_pos(sb, sinfo->bh, sinfo->de); > + > + return 0; > + } > + > + return -ENOENT; > +} > +EXPORT_SYMBOL_GPL(fat_scan_volume_label); Why do you need sinfo? -- OGAWA Hirofumi <hirof...@mail.parknet.co.jp>

  1   2   3   4   5   6   7   8   9   10   >