aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/exfat/exfat_super.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-10-04staging: exfat: Use kvzalloc() instead of kzalloc() for exfat_sb_infoJia-Ye Li1-2/+3
Fix mount failed "Cannot allocate memory". When the memory gets fragmented, kzalloc() might fail to allocate physically contiguous pages for the struct exfat_sb_info (its size is about 34KiB) even the total free memory is enough. Use kvzalloc() to solve this problem. Reviewed-by: Ethan Wu <ethanwu@synology.com> Signed-off-by: Jia-Ye Li <jiayeli@synology.com> Link: https://lore.kernel.org/r/20190925083729.4653-1-jiayeli@synology.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-01staging: exfat - fix SPDX tags..Valdis Klētnieks1-1/+1
The copyright notices as I got them said "GPLv2 or later", which I screwed up when putting in the SPDX tags. Fix them to match the license I got the code under. Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu> Link: https://lore.kernel.org/r/122590.1568853488@turing-police Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-12staging: exfat: drop unused function parameterValentin Vidic1-12/+8
sbi parameter not used inside the function so remove it. Also cleanup unused variables generated by this change. Signed-off-by: Valentin Vidic <vvidic@valentin-vidic.from.hr> Link: https://lore.kernel.org/r/20190908173539.26963-1-vvidic@valentin-vidic.from.hr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-12staging: exfat: use integer constantsValentin Vidic1-4/+4
Replace manually generated values with predefined constants. Signed-off-by: Valentin Vidic <vvidic@valentin-vidic.from.hr> Link: https://lore.kernel.org/r/20190908152616.25459-3-vvidic@valentin-vidic.from.hr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-12staging: exfat: cleanup spacing for castsValentin Vidic1-33/+33
Fix checkpatch.pl warnings: CHECK: No space is necessary after a cast Signed-off-by: Valentin Vidic <vvidic@valentin-vidic.from.hr> Link: https://lore.kernel.org/r/20190908152616.25459-2-vvidic@valentin-vidic.from.hr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-12staging: exfat: cleanup spacing for operatorsValentin Vidic1-22/+22
Fixes checkpatch.pl warnings: CHECK: spaces preferred around that '-' (ctx:VxV) CHECK: spaces preferred around that '+' (ctx:VxV) CHECK: spaces preferred around that '*' (ctx:VxV) CHECK: spaces preferred around that '|' (ctx:VxV) Signed-off-by: Valentin Vidic <vvidic@valentin-vidic.from.hr> Link: https://lore.kernel.org/r/20190908152616.25459-1-vvidic@valentin-vidic.from.hr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-06staging: exfat: stop using 32-bit time_tArnd Bergmann1-126/+38
time_t suffers from overflow problems and should not be used. In exfat, it is currently used in two open-coded time64_to_tm() implementations. Changes those to use the existing function instead. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20190906150917.1025250-2-arnd@arndb.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-06staging: exfat: stopusing CONFIG_FAT_DEFAULT_IOCHARSETArnd Bergmann1-5/+2
When CONFIG_VFAT_FS is disabled, the reference to CONFIG_FAT_DEFAULT_IOCHARSET causes a link failure: drivers/staging/exfat/exfat_super.c:46:41: error: use of undeclared identifier 'CONFIG_FAT_DEFAULT_IOCHARSET' static char exfat_default_iocharset[] = CONFIG_FAT_DEFAULT_IOCHARSET; I could not figure out why the correct code is commented out, but using that fixes the problem. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20190906150917.1025250-1-arnd@arndb.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-05staging: exfat: Use kmemdup in exfat_symlink()YueHaibing1-2/+1
Use kmemdup rather than duplicating its implementation Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20190905030047.88401-1-yuehaibing@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-05staging: exfat: remove unused including <linux/version.h>YueHaibing1-1/+0
Remove including <linux/version.h> that don't need it. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20190905025623.63210-1-yuehaibing@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-05staging: exfat: remove duplicated include from exfat_super.cYueHaibing1-1/+0
Remove duplicated include. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20190905025608.61884-1-yuehaibing@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-04staging: exfat: remove the redundant check when kfree an object in exfat_destroy_inodezhong jiang1-2/+1
kfree has taken the null check in account. hence it is unnecessary to add the null check before kfree the object. Just remove it. Reported-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: zhong jiang <zhongjiang@huawei.com> Link: https://lore.kernel.org/r/1567591408-24268-1-git-send-email-zhongjiang@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-04staging: exfat: Fix two missing unlocks on error pathsDan Carpenter1-2/+4
These two error paths need to unlock before we can return. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/20190904095908.GA7007@mwanda Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-04staging: exfat: cleanup explicit comparisons to NULLValentin Vidic1-29/+29
Fixes checkpatch.pl warnings: CHECK: Comparison to NULL could be written "expr" CHECK: Comparison to NULL could be written "!expr" Signed-off-by: Valentin Vidic <vvidic@valentin-vidic.from.hr> Link: https://lore.kernel.org/r/20190903205659.18856-1-vvidic@valentin-vidic.from.hr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-03staging: exfat: drop local TRUE/FALSE definesValentin Vidic1-8/+10
Replace with bool where it makes sense. Also drop unused local variable lossy in fat_find_dir_entry. Reported-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Valentin Vidic <vvidic@valentin-vidic.from.hr> Link: https://lore.kernel.org/r/20190903185537.25099-1-vvidic@valentin-vidic.from.hr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-03staging: exfat: fix spelling errors in commentsValentin Vidic1-1/+1
Fixes checkpatch.pl warnings: CHECK: 'consistancy' may be misspelled - perhaps 'consistency'? CHECK: 'stuct' may be misspelled - perhaps 'struct'? Signed-off-by: Valentin Vidic <vvidic@valentin-vidic.from.hr> Link: https://lore.kernel.org/r/20190903165408.16010-1-vvidic@valentin-vidic.from.hr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-03staging: exfat: cleanup braces for if/else statementsValentin Vidic1-7/+9
Fixes checkpatch.pl warnings: CHECK: Unbalanced braces around else statement CHECK: braces {} should be used on all arms of this statement Signed-off-by: Valentin Vidic <vvidic@valentin-vidic.from.hr> Link: https://lore.kernel.org/r/20190903164732.14194-1-vvidic@valentin-vidic.from.hr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-03staging: exfat: remove return and error return via a gotoColin Ian King1-1/+1
The return statement is incorrect, the error exit should be by assigning ret with the error code and exiting via label out. Thanks to Valdis Klētnieks for correcting my original fix. Addresses-Coverity: ("Structurally dead code") Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20190902094052.28029-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-03staging: exfat: fix uninitialized variable retColin Ian King1-1/+1
Currently there are error return paths in ffsReadFile that exit via lable err_out that return and uninitialized error return in variable ret. Fix this by initializing ret to zero. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: c48c9f7ff32b ("staging: exfat: add exfat filesystem code to staging") Signed-off-by: Colin Ian King <colin.king@canonical.com> Cc: Valdis Kletnieks <valdis.kletnieks@vt.edu>, Reviewed-by: Nathan Chancellor <natechancellor@gmail.com> Link: https://lore.kernel.org/r/20190830184644.15590-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-03staging: exfat: cleanup blank line warningsValentin Vidic1-1/+0
Fixes checkpatch.pl warnings: CHECK: Please don't use multiple blank lines CHECK: Blank lines aren't necessary after an open brace '{' CHECK: Please use a blank line after function/struct/union/enum declarations Signed-off-by: Valentin Vidic <vvidic@valentin-vidic.from.hr> Link: https://lore.kernel.org/r/20190902190329.18685-1-vvidic@valentin-vidic.from.hr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-02drivers/staging/exfat - by default, prohibit mount of fat/vfatValdis Klētnieks1-0/+6
Concerns have been raised about the exfat driver accidentally mounting fat/vfat file systems. Add an extra configure option to help prevent that. Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu> Link: https://lore.kernel.org/r/245727.1567183359@turing-police Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-08-30staging: exfat: add exfat filesystem code to stagingValdis Klētnieks1-0/+4137
The exfat code needs a lot of work to get it into "real" shape for the fs/ part of the kernel, so put it into drivers/staging/ for now so that it can be worked on by everyone in the community. The full specification of the filesystem can be found at: https://docs.microsoft.com/en-us/windows/win32/fileio/exfat-specification Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/20190828160817.6250-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>