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
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/
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 ++
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)
>>
>>
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
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
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
at_time_unix2fat(struct msdos_sb_info *sbi, struct timespec64 *ts,
--
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
> ---
&
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
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
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-
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
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
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
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(+)
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
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
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
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
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
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
irectory (invalid size %lld)\n",
> + __func__, i_size_read(inode));
> + return -EIO;
> + }
> +
> return 0;
> }
--
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/
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
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
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
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
ithub.com/OGAWAHirofumi/linux-tux3/tree/hirofumi-user
Thanks.
--
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
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
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
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
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(-)
.
(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
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
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
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
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
e,
> .fallocate = fat_fallocate,
> };
Looks good.
Acked-by: OGAWA Hirofumi
Thanks.
--
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
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
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
.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
o, now FAT_FIRST_ENT() is pointed only from comment. The reason
is only for this comment.
Thanks.
--
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
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
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
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
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
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
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
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
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
/*
*
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
/*
*
ting FAT
sector_size >= 8192. After that, it would be safe to remove 4096
limitation.
Thanks.
--
OGAWA Hirofumi
ting FAT
sector_size >= 8192. After that, it would be safe to remove 4096
limitation.
Thanks.
--
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
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
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
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
_LINUX_MSDOS_FS_H */
This is ok though, this would be for ancient floppy media.
Thanks.
--
OGAWA Hirofumi
_LINUX_MSDOS_FS_H */
This is ok though, this would be for ancient floppy media.
Thanks.
--
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
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
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
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
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
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
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
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
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
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
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 -
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 -
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
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
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
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
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
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
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
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
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)
>>> +{
>>
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;
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>
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
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>
_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
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>
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
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;
> +
>
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
");
> + 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>
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
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>
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
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>
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
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 - 100 of 1023 matches
Mail list logo