aboutsummaryrefslogtreecommitdiff
path: root/fs
Commit message (Collapse)AuthorAgeFilesLines
* ANDROID: sdcardfs: Use seq_puts over seq_printfDaniel Rosenberg2017-04-131-1/+1
| | | | | | Signed-off-by: Daniel Rosenberg <drosen@google.com> Bug: 35331000 Change-Id: I3795ec61ce61e324738815b1ce3b0e09b25d723f
* ANDROID: sdcardfs: Use to kstroutDaniel Rosenberg2017-04-131-1/+7
| | | | | | | | Switch from deprecated simple_strtoul to kstrout Signed-off-by: Daniel Rosenberg <drosen@google.com> Bug: 35331000 Change-Id: If18bd133b4d2877f71e58b58fc31371ff6613ed5
* ANDROID: sdcardfs: Use pr_[...] instead of printkDaniel Rosenberg2017-04-138-50/+43
| | | | | | Signed-off-by: Daniel Rosenberg <drosen@google.com> Bug: 35331000 Change-Id: Ibc635ec865750530d32b87067779f681fe58a003
* ANDROID: sdcardfs: remove unneeded null checkDaniel Rosenberg2017-04-133-6/+3
| | | | | | | | | As pointed out by checkpatch, these functions already handle null inputs, so the checks are not needed. Signed-off-by: Daniel Rosenberg <drosen@google.com> Bug: 35331000 Change-Id: I189342f032dfcefee36b27648bb512488ad61d20
* ANDROID: sdcardfs: Fix style issues with commentsDaniel Rosenberg2017-04-133-22/+5
| | | | | | Signed-off-by: Daniel Rosenberg <drosen@google.com> Bug: 35331000 Change-Id: I8791ef7eac527645ecb9407908e7e5ece35b8f80
* ANDROID: sdcardfs: Fix formattingDaniel Rosenberg2017-04-1310-259/+312
| | | | | | | | | This fixes various spacing and bracket related issues pointed out by checkpatch. Signed-off-by: Daniel Rosenberg <drosen@google.com> Bug: 35331000 Change-Id: I6e248833a7a04e3899f3ae9462d765cfcaa70c96
* ANDROID: sdcardfs: correct order of descriptorsDaniel Rosenberg2017-04-131-1/+3
| | | | | | Signed-off-by: Daniel Rosenberg <drosen@google.com> Bug: 35331000 Change-Id: Ia6d16b19c8c911f41231d2a12be0740057edfacf
* ANDROID: sdcardfs: Fix gid issueDaniel Rosenberg2017-04-132-14/+6
| | | | | | | | | | We were already calculating most of these values, and erroring out because the check was confused by this. Instead of recalculating, adjust it as needed. Signed-off-by: Daniel Rosenberg <drosen@google.com> Bug: 36160015 Change-Id: I9caf3e2fd32ca2e37ff8ed71b1d392f1761bc9a9
* ANDROID: sdcardfs: Use tabs instead of spaces in multiuser.hDaniel Rosenberg2017-04-131-11/+11
| | | | | | Signed-off-by: Daniel Rosenberg <drosen@google.com> Bug: 35331000 Change-Id: Ic7801914a7dd377e270647f81070020e1f0bab9b
* ANDROID: sdcardfs: Remove uninformative printsDaniel Rosenberg2017-04-134-30/+1
| | | | | | | | | At best these prints do not provide useful information, and at worst, some allow userspace to abuse the kernel log. Signed-off-by: Daniel Rosenberg <drosen@google.com> Bug: 36138424 Change-Id: I812c57cc6a22b37262935ab77f48f3af4c36827e
* ANDROID: sdcardfs: move path_put outside of spinlockDaniel Rosenberg2017-04-131-1/+6
| | | | | | Signed-off-by: Daniel Rosenberg <drosen@google.com> Bug: 35643557 Change-Id: Ib279ebd7dd4e5884d184d67696a93e34993bc1ef
* ANDROID: sdcardfs: Use case insensitive hash functionDaniel Rosenberg2017-04-131-1/+10
| | | | | | | | | Case insensitive comparisons don't help us much if we hash to different buckets... Signed-off-by: Daniel Rosenberg <drosen@google.com> bug: 36004503 Change-Id: I91e00dbcd860a709cbd4f7fd7fc6d855779f3285
* ANDROID: sdcardfs: declare MODULE_ALIAS_FSDaniel Rosenberg2017-04-131-0/+1
| | | | | | | | From commit ee616b78aa87 ("Wrapfs: declare MODULE_ALIAS_FS") Signed-off-by: Daniel Rosenberg <drosen@google.com> bug: 35766959 Change-Id: Ia4728ab49d065b1d2eb27825046f14b97c328cba
* ANDROID: sdcardfs: Get the blocksize from the lower fsDaniel Rosenberg2017-04-131-12/+9
| | | | | | | | | | This changes sdcardfs to be more in line with the getattr in wrapfs, which calls the lower fs's getattr to get the block size Signed-off-by: Daniel Rosenberg <drosen@google.com> Bug: 34723223 Change-Id: I1c9e16604ba580a8cdefa17f02dcc489d7351aed
* ANDROID: sdcardfs: Use d_invalidate instead of drop_recurisveDaniel Rosenberg2017-04-133-41/+1
| | | | | | | | | | | drop_recursive did not properly remove stale dentries. Instead, we use the vfs's d_invalidate, which does the proper cleanup. Additionally, remove the no longer used drop_recursive, and fixup_top_recursive that that are no longer used. Signed-off-by: Daniel Rosenberg <drosen@google.com> Change-Id: Ibff61b0c34b725b024a050169047a415bc90f0d8
* ANDROID: sdcardfs: Switch to internal case insensitive compareDaniel Rosenberg2017-04-134-13/+10
| | | | | | | | | | | | | | | There were still a few places where we called into a case insensitive lookup that was not defined by sdcardfs. Moving them all to the same place will allow us to switch the implementation in the future. Additionally, the check in fixup_perms_recursive did not take into account the length of both strings, causing extraneous matches when the name we were looking for was a prefix of the child name. Signed-off-by: Daniel Rosenberg <drosen@google.com> Change-Id: I45ce768cd782cb4ea1ae183772781387c590ecc2
* ANDROID: sdcardfs: Use spin_lock_nestedDaniel Rosenberg2017-04-131-2/+2
| | | | | | Signed-off-by: Daniel Rosenberg <drosen@google.com> Bug: 36007653 Change-Id: I805d5afec797669679853fb2bb993ee38e6276e4
* ANDROID: sdcardfs: Replace get/put with d_lockDaniel Rosenberg2017-04-131-13/+19
| | | | | | | | | dput cannot be called with a spin_lock. Instead, we protect our accesses by holding the d_lock. Signed-off-by: Daniel Rosenberg <drosen@google.com> Bug: 35643557 Change-Id: I22cf30856d75b5616cbb0c223724f5ab866b5114
* ANDROID: sdcardfs: rate limit warning printDaniel Rosenberg2017-04-131-2/+3
| | | | | | Signed-off-by: Daniel Rosenberg <drosen@google.com> Bug: 35848445 Change-Id: Ida72ea0ece191b2ae4a8babae096b2451eb563f6
* ANDROID: sdcardfs: Fix case insensitive lookupDaniel Rosenberg2017-04-131-17/+51
| | | | | | | | | | The previous case insensitive lookup relied on the entry being present in the dcache. This instead uses iterate_dir to find the correct case. Signed-off-by: Daniel Rosenberg <drosen@google.com bug: 35633782 Change-Id: I556f7090773468c1943c89a5e2aa07f746ba49c5
* timerfd: Remove an always true checkDan Carpenter2017-04-131-2/+1
| | | | | | | | | | We would have returned -EINVAL earlier if ticks wasn't set. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: Alexander Viro <viro@zeniv.linux.org.uk> Cc: Cyrill Gorcunov <gorcunov@openvz.org> Link: http://lkml.kernel.org/r/20140801082848.GF28869@mwanda Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* timerfd: Implement timerfd_ioctl method to restore timerfd_ctx::ticks, v3Cyrill Gorcunov2017-04-131-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The read() of timerfd files allows to fetch the number of timer ticks while there is no way to set it back from userspace. To restore the timer's state as it was at checkpoint moment we need a path to bring @ticks back. Initially I thought about writing ticks back via write() interface but it seems such API is somehow obscure. Instead implement timerfd_ioctl() method with TFD_IOC_SET_TICKS command which allows to adjust @ticks into non-zero value waking up the waiters. I wrapped code with CONFIG_CHECKPOINT_RESTORE which can be dropped off if there users except c/r camp appear. v2 (by akpm@): - Use define timerfd_ioctl NULL for non c/r config v3: - Use copy_from_user for @ticks fetching since not all arch support get_user for 8 byte argument Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Andrey Vagin <avagin@openvz.org> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Christopher Covington <cov@codeaurora.org> Cc: Pavel Emelyanov <xemul@parallels.com> Cc: Vladimir Davydov <vdavydov@parallels.com> Link: http://lkml.kernel.org/r/20140715215703.285617923@openvz.org Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* timerfd: Implement show_fdinfo methodCyrill Gorcunov2017-04-131-1/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For checkpoint/restore of timerfd files we need to know how exactly the timer were armed, to be able to recreate it on restore stage. Thus implement show_fdinfo method which provides enough information for that. One of significant changes I think is the addition of @settime_flags member. Currently there are two flags TFD_TIMER_ABSTIME and TFD_TIMER_CANCEL_ON_SET, and the second can be found from @might_cancel variable but in case if the flags will be extended in future we most probably will have to somehow remember them explicitly anyway so I guss doing that right now won't hurt. To not bloat the timerfd_ctx structure I've converted @expired to short integer and defined @settime_flags as short too. v2 (by avagin@, vdavydov@ and tglx@): - Add it_value/it_interval fields - Save flags being used in timerfd_setup in context v3 (by tglx@): - don't forget to use CONFIG_PROC_FS v4 (by akpm@): -Use define timerfd_show NULL for non c/r config Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Andrey Vagin <avagin@openvz.org> Cc: Pavel Emelyanov <xemul@parallels.com> Cc: Vladimir Davydov <vdavydov@parallels.com> Link: http://lkml.kernel.org/r/20140715215703.114365649@openvz.org Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* ANDROID: Put KUSER_HELPERS disable behind configmspector2017-04-131-4/+4
| | | | | | | | | | | | | This change puts the KUSER_HELPERS selective disable behind the KCONFIG KUSER_HELPERS_SELECTIVE_DISABLE. Original patch adding KUSER_HELPERS: 2bed8acb3c3d44c66d979fed9bdd4ea69cb8650b I8d6d75cc8e1b2280f2436fd3334ff3779ae3539a Signed-off-by: mspector <mspector@google.com> Change-Id: I54c606f1f39823abf0a754eef69569cbfb63f8af Bug: 34815073
* ANDROID: Fixing incorrect return value on errormspector2017-04-131-2/+6
| | | | | | | | | | | | This fixes an incorrect return value from should_call_arch_setup_additional_pages when kernel_read returns a different length than expected, the length is returned. The fix is to return -EIO instead. Signed-off-by: mspector <mspector@google.com> Bug: 34749002 Change-Id: I484ad801ce114b4dfe9f62b8b83c960cb693c9b6
* ANDROID: Fix for building non-arm64mspector2017-04-131-0/+2
| | | | | | | | This patch fixes the build break for arch=um Signed-off-by: mspector <mspector@google.com> Bug: 33689037 Change-Id: I245cd39a5ed41c884422b69720afcba7a55b42e1
* ANDROID: Support to disable arm32 Kuser_Helpersmspector2017-04-131-5/+102
| | | | | | | | | | This patch adds support to disable kuser_helpers from being mapped into 32 bit processes on arm64. It also adds an ELF note that tells the kernel to map the page in for the specific process. Signed-off-by: mspector <mspector@google.com> Bug: 33689037 Change-Id: I8d6d75cc8e1b2280f2436fd3334ff3779ae3539a
* f2fs: use __set{__clear}_bit_leJaegeuk Kim2017-04-131-3/+3
| | | | | | | This patch uses __set{__clear}_bit_le for highter speed. Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: update_free_nid_bitmap() can be statickbuild test robot2017-04-131-2/+2
| | | | | Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: __update_nat_bits() can be statickbuild test robot2017-04-131-1/+1
| | | | | Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: le16_to_cpu for xattr->e_value_sizeJaegeuk Kim2017-04-131-1/+3
| | | | | | | This patch fixes missing le16 conversion, reported by kbuild test robot. Fixes: 5f35a2cd5 ("f2fs: Don't update the xattr data that same as the exist") Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: don't overwrite node block by SSRJaegeuk Kim2017-04-131-0/+6
| | | | | | | | | This patch fixes that SSR can overwrite previous warm node block consisting of a node chain since the last checkpoint. Fixes: 5b6c6be2d878 ("f2fs: use SSR for warm node as well") Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: don't need to invalidate wrong node pageJaegeuk Kim2017-04-131-1/+4
| | | | | | | | If f2fs_new_inode() is failed, the bad inode will invalidate 0'th node page during f2fs_evict_inode(), which doesn't need to do. Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: fix an error return value in truncate_partial_data_pageYunlei He2017-04-131-1/+1
| | | | | | | This patch fix a error return value in truncate_partial_data_page Signed-off-by: Yunlei He <heyunlei@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* fscrypt: catch up to v4.11-rc1Jaegeuk Kim2017-04-1312-378/+501
| | | | | | | | | | | | | | | Keep validate_user_key() due to kasprintf() panic. fscrypt: - skcipher_ -> ablkcipher_ - fs/crypto/bio.c changes f2fs: - fscrypt: use ENOKEY when file cannot be created w/o key - fscrypt: split supp and notsupp declarations into their own headers - fscrypt: make fscrypt_operations.key_prefix a string Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: avoid to flush nat journal entriesJaegeuk Kim2017-04-131-1/+1
| | | | | | | | | | This patch adds a missing condition which flushes nat journal entries unnecessarily introduced by: f2fs: add bitmaps for empty or full NAT blocks Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: avoid to issue redundant discard commandsJaegeuk Kim2017-04-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | If segs_per_sec is over 1 like under SMR, previously f2fs issues discard commands redundantly on the same section, since we didn't move end position for the previous discard command. E.g., start end | | prefree_bitmap = [01111100111100] And, after issue discard for this section, end start | | prefree_bitmap = [01111100111100] Select this section again by searching from (end + 1), start end | | prefree_bitmap = [01111100111100] Fixes: 36abef4e796d38 ("f2fs: introduce mode=lfs mount option") Cc: <stable@vger.kernel.org> Cc: Damien Le Moal <damien.lemoal@wdc.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: fix a plint compile warningHou Pengyang2017-04-131-1/+1
| | | | | | | | | fix such pclint warning: ... Loss of precision (arg. no. 2) (unsigned long long to unsigned int)) Signed-off-by: Hou Pengyang <houpengyang@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: add f2fs_drop_inode tracepointHou Pengyang2017-04-131-2/+5
| | | | | Signed-off-by: Hou Pengyang <houpengyang@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: Fix zoned block device supportMasato Suzuki2017-04-131-23/+48
| | | | | | | | | | | | | | | | | | | | | | | The introduction of the multi-device feature partially broke the support for zoned block devices. In the function f2fs_scan_devices, sbi->devs allocation and initialization is skipped in the case of a single device mount. This result in no device information structure being allocated for the device. This is fine if the device is a regular device, but in the case of a zoned block device, the device zone type array is not initialized, which causes the function __f2fs_issue_discard_zone to fail as get_blkz_type is unable to determine the zone type of a section. Fix this by always allocating and initializing the sbi->devs device information array even in the case of a single device if that device is zoned. For this particular case, make sure to obtain a reference on the single device so that the call to blkdev_put() in destroy_device_list operates as expected. Fixes: 3c62be17d4f562f4 ("f2fs: support multiple devices") Cc: <stable@vger.kernel.org> # v4.10 Signed-off-by: Masato Suzuki <masato.suzuki@wdc.com> Acked-by: Damien Le Moal <damien.lemoal@wdc.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: remove redundant set_page_dirty()Yunlei He2017-04-131-2/+1
| | | | | | | This patch remove redundant set_page_dirty in truncate_blocks Signed-off-by: Yunlei He <heyunlei@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: fix to enlarge size of write_io_dummy mempoolChao Yu2017-04-131-1/+1
| | | | | | | | It needs to double cache size of write_io_dummy mempool, otherwise we may run out of cache in scenraio of Data/Node IOs were issued concurrently. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: fix memory leak of write_io_dummy mempool during umountChao Yu2017-04-131-1/+2
| | | | | Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: fix to update F2FS_{CP_}WB_DATA count correctlyChao Yu2017-04-131-1/+2
| | | | | | | We should only account F2FS_{CP_}WB_DATA IOs for write path, fix it. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: use MAX_FREE_NIDS for the free nids targetKinglong Mee2017-04-131-5/+3
| | | | | | | | F2FS has define MAX_FREE_NIDS for maximum of cached free nids target. Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: introduce free nid bitmapChao Yu2017-04-133-10/+119
| | | | | | | | | | | | | | | | | | | | | | In scenario of intensively node allocation, free nids will be ran out soon, then it needs to stop to load free nids by traversing NAT blocks, in worse case, if NAT blocks does not be cached in memory, it generates IOs which slows down our foreground operations. In order to speed up node allocation, in this patch we introduce a new free_nid_bitmap array, so there is an bitmap table for each NAT block, Once the NAT block is loaded, related bitmap cache will be switched on, and bitmap will be set during traversing nat entries in NAT block, later we can query and update nid usage status in memory completely. With such implementation, I expect performance of node allocation can be improved in the long-term after filesystem image is mounted. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Conflicts: include/linux/f2fs_fs.h
* f2fs: new helper cur_cp_crc() getting crc in f2fs_checkpointKinglong Mee2017-04-134-19/+15
| | | | | | | | There are four places that getting the crc value in f2fs_checkpoint, just add a new helper cur_cp_crc for them. Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: update the comment of default nr_pages to skippingKinglong Mee2017-04-131-2/+2
| | | | | | Fixes: 2c237ebaa4 ("f2fs: avoid writing node/metapages during writes") Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: drop the duplicate pval in f2fs_getxattrKinglong Mee2017-04-131-3/+0
| | | | | | Fixes: ba38c27eb9 ("f2fs: enhance lookup xattr") Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: Don't update the xattr data that same as the existKinglong Mee2017-04-131-4/+16
| | | | | | | | f2fs removes the old xattr data and appends the new data although the new data is same as the exist. Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>