summaryrefslogtreecommitdiffstats
path: root/fs/befs
Commit message (Collapse)AuthorAgeFilesLines
...
| * befs: add flags field to validate superblock stateSalah Triki2016-10-082-1/+6
| | | | | | | | | | | | | | | | For validating superblock state, add flags field to befs_sb_info, read the state from the disk and check if it is equal to BEFS_DIRTY. Signed-off-by: Salah Triki <salah.triki@gmail.com> Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
| * befs: fix typo in befs_find_keyLuis de Bethencourt2016-10-081-1/+1
| | | | | | | | | | | | | | Fixing skeep to skip. Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Signed-off-by: Salah Triki <salah.triki@gmail.com>
| * befs: remove unused BEFS_BT_PARMATCHLuis de Bethencourt2016-10-082-19/+16
| | | | | | | | | | | | | | | | | | | | befs_btree_find(), the only caller of befs_find_key(), only cares about if the return from that function is BEFS_BT_MATCH or not. It never uses the partial match given with BEFS_BT_PARMATCH. Make the overflow return clearer by having BEFS_BT_OVERFLOW instead of BEFS_BT_PARMATCH. Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Signed-off-by: Salah Triki <salah.triki@gmail.com>
| * fs: befs: remove ret variableSalah Triki2016-10-081-2/+1
| | | | | | | | | | | | | | | | ret is initialized to -EIO and is never modified, so remove ret and use -EIO directly. Signed-off-by: Salah Triki <salah.triki@gmail.com> Acked-by: Luis de Bethencourt <luisbg@osg.samsung.com>
| * fs: befs: remove in vain variable assignmentSalah Triki2016-10-081-1/+1
| | | | | | | | | | | | | | | | There is no need to init res, since it will be overwitten later by befs_fblock2brun(). Signed-off-by: Salah Triki <salah.triki@gmail.com> Acked-by: Luis de Bethencourt <luisbg@osg.samsung.com>
| * fs: befs: remove unnecessary *befs_sb variableSalah Triki2016-10-081-2/+1
| | | | | | | | | | | | | | | | Remove *befs_sb and just call BEFS_SB(sb) directly, since the returned value by this function is only used once. Signed-off-by: Salah Triki <salah.triki@gmail.com> Acked-by: Luis de Bethencourt <luisbg@osg.samsung.com>
| * fs: befs: remove useless initialization to zeroSalah Triki2016-10-081-1/+1
| | | | | | | | | | | | | | | | node_off is unconditionally set to bt_super.root_node_ptr, so no need to init it to zero. Signed-off-by: Salah Triki <salah.triki@gmail.com> Acked-by: Luis de Bethencourt <luisbg@osg.samsung.com>
| * fs: befs: remove in vain variable assignmentSalah Triki2016-10-081-2/+0
| | | | | | | | | | | | | | There is no need to set *value, it will be overwritten later. Signed-off-by: Salah Triki <salah.triki@gmail.com> Acked-by: Luis de Bethencourt <luisbg@osg.samsung.com>
| * fs: befs: Insert NULL inode to dentrySalah Triki2016-10-081-0/+1
| | | | | | | | | | | | | | | | As VFS expects, lookup inserts NULL inode to dentry when the named inode does not exist. Signed-off-by: Salah Triki <salah.triki@gmail.com> Acked-by: Luis de Bethencourt <luisbg@osg.samsung.com>
| * fs: befs: Remove useless calls to brelse in befs_find_brun_dblindirectSalah Triki2016-10-081-2/+0
| | | | | | | | | | | | | | | | The calls to brelse are useless since dbl_indir_block and indir_block are NULL. Signed-off-by: Salah Triki <salah.triki@gmail.com> Acked-by: Luis de Bethencourt <luisbg@osg.samsung.com>
| * fs: befs: Coding style fixSalah Triki2016-10-081-3/+3
| | | | | | | | | | | | | | Constant has to be capitalized. Signed-off-by: Salah Triki <salah.triki@gmail.com> Acked-by: Luis de Bethencourt <luisbg@osg.samsung.com>
| * fs: befs: Remove redundant validation from befs_find_brun_directSalah Triki2016-10-081-8/+0
| | | | | | | | | | | | | | | | | | The only caller of befs_find_brun_direct is befs_fblock2brun, which already validates that the block is within the range of direct blocks. So remove the duplicate validation. Signed-off-by: Salah Triki <salah.triki@gmail.com> Acked-by: Luis de Bethencourt <luisbg@osg.samsung.com>
| * befs: fix typo in befs_bt_read_node documentationLuis de Bethencourt2016-10-081-2/+2
| | | | | | | | | | | | Fixing a grammatical error in the documentation. Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
| * befs: in memory free_node_ptr and max_size never readLuis de Bethencourt2016-10-081-2/+0
| | | | | | | | | | | | | | | | The only place the values of free_node_ptr and max_size are read is in befs_dump_index_entry(), which both times it is called, it is passed the on disk superblock. Removing assignment of unused values. Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
| * befs: make consistent use of befs_error()Luis de Bethencourt2016-10-083-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | befs_error() is used in potential errors that could happen in befs to provide informational log messages. befs_debug() is silent when CONFIG_BEFS_DEBUG=no, and very verbose when switched on, which is why it is used for general debugging but not for errors. Fix a few cases where the befs debug utility usage isn't following the expected pattern. To make sure we have consistent information in the logs. Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
| * befs: use simpler while loopLuis de Bethencourt2016-10-081-36/+38
| | | | | | | | | | | | Replace goto with simpler while loop to make befs_readdir() more readable. Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
| * befs: remove constant variableLuis de Bethencourt2016-10-081-5/+2
| | | | | | | | | | | | | | Use macro directly instead of via assigning it to an unchanging variable. Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Acked-by: Salah Triki <salah.triki@gmail.com>
| * befs: avoid dereferencing dentry twiceLuis de Bethencourt2016-10-081-1/+1
| | | | | | | | | | | | | | No need to dereference dentry twice to get the name when we already have it stored in a local variable. Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
| * fs: befs: remove comment that confuses kernel-docLuis de Bethencourt2016-10-081-4/+0
| | | | | | | | | | | | | | | | This comment with a mysterious unfinished line confuses the kernel-doc system since, because it starts with /**, it thinks it is documenting a function. Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
| * fs: befs: check silent flag before logging errorLuis de Bethencourt2016-10-081-1/+2
| | | | | | | | | | | | | | | | Log error only when silent flag is not set. Fixes: dbe6460388bc ("fs/befs/linuxvfs.c: check silent flag before logging errors") Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Acked-by: Salah Triki <salah.triki@gmail.com>
| * fs: befs: replace befs_bread by sb_breadSalah Triki2016-10-084-30/+4
| | | | | | | | | | | | | | | | | | Since befs_bread merely calls sb_bread, replace it by sb_bread. Link: http://lkml.kernel.org/r/1466800258-4542-1-git-send-email-salah.triki@gmail.com Signed-off-by: Salah Triki <salah.triki@gmail.com> Acked-by: Luis de Bethencourt <luisbg@osg.samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * befs: remove unused functionsLuis de Bethencourt2016-10-081-12/+0
| | | | | | | | | | | | | | | | befs_iaddr_is_empty() and befs_brun_size() are unused. Remove them. Link: http://lkml.kernel.org/r/1465700235-22881-3-git-send-email-luisbg@osg.samsung.com Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * befs: fix function name in documentationLuis de Bethencourt2016-10-081-1/+1
| | | | | | | | | | | | | | | | | | Documentation of function befs_load_cb() lists it as load_befs_sb(). Fix the misnomer. Link: http://lkml.kernel.org/r/1465700235-22881-2-git-send-email-luisbg@osg.samsung.com Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * befs: check return of sb_min_blocksizeLuis de Bethencourt2016-10-081-1/+6
| | | | | | | | | | | | | | | | Confirm sb_min_blocksize() succeeded before continuing. Link: http://lkml.kernel.org/r/1465700235-22881-1-git-send-email-luisbg@osg.samsung.com Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * fs: befs: remove useless pr_err in befs_init_inodecache()Salah Triki2016-10-081-4/+2
| | | | | | | | | | | | | | Remove pr_err since kmem_cache_create log error and dump stack. Link: http://lkml.kernel.org/r/e6d03cbc9542495dc6174b59e32fcd41c1393cfc.1464226521.git.salah.triki@acm.org Signed-off-by: Salah Triki <salah.triki@acm.org>
| * fs/befs/linuxvfs.c: remove useless befs_errorSalah Triki2016-10-081-2/+0
| | | | | | | | | | | | | | | | | | Remove befs_error since when kmalloc fails there is a generic out of memory and stack dump. Link: http://lkml.kernel.org/r/3de4d388d98bbb570462a5eb8e64623e17fb5d74.1464226521.git.salah.triki@acm.org Signed-off-by: Salah Triki <salah.triki@acm.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * fs/befs/linuxvfs.c: remove useless pr_err in befs_fill_super()Salah Triki2016-10-081-4/+2
| | | | | | | | | | | | | | | | | | Remove pr_err since when kzalloc fails there is a generic out of memory and stack dump. Link: http://lkml.kernel.org/r/c5a7f2d42ec0fc8465c118248e88cd221c483391.1464226521.git.salah.triki@acm.org Signed-off-by: Salah Triki <salah.triki@acm.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * fs/befs/linuxvfs.c: check silent flag before logging errorsSalah Triki2016-10-081-6/+9
| | | | | | | | | | | | | | | | Log errors only when silent flag is not set. Link: http://lkml.kernel.org/r/d400aaf5a7430de79bd956e40ec075fb1cb08474.1464226521.git.salah.triki@acm.org Signed-off-by: Salah Triki <salah.triki@acm.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * fs/befs/linuxvfs.c: move useless assignmentSalah Triki2016-10-081-1/+1
| | | | | | | | | | | | | | | | | | | | Control is transfered to unacquire_none when sb->s_fs_info is equal to NULL, so the assignment to NULL is useless and it is moved above unacquire_none. Link: http://lkml.kernel.org/r/ed41da113fc693c7daa4e8813ca04cc766ddfc05.1464226521.git.salah.triki@acm.org Signed-off-by: Salah Triki <salah.triki@acm.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
* | block: remove remnant refs to hardsectLinus Walleij2016-09-141-1/+1
|/ | | | | | | | | | | | | | commit e1defc4ff0cf57aca6c5e3ff99fa503f5943c1f1 "block: Do away with the notion of hardsect_size" removed the notion of "hardware sector size" from the kernel in favor of logical block size, but references remain in comments and documentation. Update the remaining sites mentioning hardsect. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
* fs/befs/io.c:befs_bread(): remove unneeded initialization to NULLSalah Triki2016-05-231-1/+1
| | | | | | | | | | bh is reinitialized by sb_bread() so no need to init it with NULL in the beginning of befs_bread() Link: http://lkml.kernel.org/r/88481760b43226fac16adb1f1e68897e47d8235c.1462841692.git.salah.triki@acm.org Signed-off-by: Salah Triki <salah.triki@acm.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* fs/befs/io.c:befs_bread_iaddr(): remove unneeded initialization to NULLSalah Triki2016-05-231-1/+1
| | | | | | | | | | bh is reinitialized by sb_bread() so no need to init it with NULL in the beginning of befs_bread_iaddr() Link: http://lkml.kernel.org/r/586d2639d729345b9c07aac10ba713d8ceb8745a.1462841692.git.salah.triki@acm.org Signed-off-by: Salah Triki <salah.triki@acm.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* fs/befs/linuxvfs.c:befs_iget(): remove unneeded befs_nio initialization to NULLSalah Triki2016-05-231-1/+1
| | | | | | | | | | befs_ino is reinitialized by BEFS_I() so no need to init it with NULL in the beginning of befs_iget() Link: http://lkml.kernel.org/r/a5c02445e436629c4d4ba1b65d91501878942f58.1462842887.git.salah.triki@acm.org Signed-off-by: Salah Triki <salah.triki@acm.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* fs/befs/linuxvfs.c:befs_iget(): remove unneeded raw_inode initialization to NULLSalah Triki2016-05-231-1/+1
| | | | | | | | | | raw_inode is reinitialized to bh->b_data so no need to init it with NULL in the beginning of befs_iget() Link: http://lkml.kernel.org/r/0a66baaaacb6b7e5fcea5b31b57b649261152281.1462842887.git.salah.triki@acm.org Signed-off-by: Salah Triki <salah.triki@acm.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* fs/befs/linuxvfs.c:befs_iget(): remove unneeded initialization to NULLSalah Triki2016-05-231-1/+1
| | | | | | | | | | bh is reinitialized by befs_bread() so no need to init it with NULL in the beginning of befs_iget() Link: http://lkml.kernel.org/r/38d62b1469bc3b316ba6b81fd8e26fc66fdd713b.1462842886.git.salah.triki@acm.org Signed-off-by: Salah Triki <salah.triki@acm.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* fs/befs/linuxvfs.c:befs_get_block(): remove unneeded initialization to NULLSalah Triki2016-05-231-1/+1
| | | | | | | | | | inode is reinitialized by befs_iget() so no need to init it with NULL in the beginning of befs_lookup() Link: http://lkml.kernel.org/r/03d7e46890aef94078130bed97c4f8f8ae9ea2b2.1462842886.git.salah.triki@acm.org Signed-off-by: Salah Triki <salah.triki@acm.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* fs/befs/datastream.c:befs_find_brun_dblindirect(): remove unneeded ↵Salah Triki2016-05-231-3/+1
| | | | | | | | | | | | initializations to NULL iaddr_array is unconditionally initialized to NULL in befs_find_brun_dblindirect(). Link: http://lkml.kernel.org/r/940def273e30ef37957fba9da6981a10fb3c9741.1462649034.git.salah.triki@acm.org Signed-off-by: Salah Triki <salah.triki@acm.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* fs/befs/datastream.c:befs_read_lsymlink(): remove unneeded initialization to ↵Salah Triki2016-05-231-1/+1
| | | | | | | | | | | | NULL bh is reinitialized by befs_read_datastream() so no need to init it with NULL in the beginning of befs_read_lsymlink(). Link: http://lkml.kernel.org/r/e22f279bceb8d026af048952e02ba98925b21c92.1462649034.git.salah.triki@acm.org Signed-off-by: Salah Triki <salah.triki@acm.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* fs/befs/datastream.c:befs_read_datastream(): remove unneeded initialization ↵Salah Triki2016-05-231-1/+1
| | | | | | | | | | | | to NULL bh is reinitialized by befs_bread_iaddr() so no need to init it with NULL in the beginning of befs_read_datastream(). Link: http://lkml.kernel.org/r/81e1f70187db34d195c8e42b1ff78be6a71c0060.1462649034.git.salah.triki@acm.org Signed-off-by: Salah Triki <salah.triki@acm.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* befs: switch to ->iterate_shared()Al Viro2016-05-101-1/+1
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* befs: constify stuff a bitAl Viro2016-05-106-31/+34
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* kmemcg: account certain kmem allocations to memcgVladimir Davydov2016-01-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mark those kmem allocations that are known to be easily triggered from userspace as __GFP_ACCOUNT/SLAB_ACCOUNT, which makes them accounted to memcg. For the list, see below: - threadinfo - task_struct - task_delay_info - pid - cred - mm_struct - vm_area_struct and vm_region (nommu) - anon_vma and anon_vma_chain - signal_struct - sighand_struct - fs_struct - files_struct - fdtable and fdtable->full_fds_bits - dentry and external_name - inode for all filesystems. This is the most tedious part, because most filesystems overwrite the alloc_inode method. The list is far from complete, so feel free to add more objects. Nevertheless, it should be close to "account everything" approach and keep most workloads within bounds. Malevolent users will be able to breach the limit, but this was possible even with the former "account everything" approach (simply because it did not account everything in fact). [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Vladimir Davydov <vdavydov@virtuozzo.com> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Acked-by: Michal Hocko <mhocko@suse.com> Cc: Tejun Heo <tj@kernel.org> Cc: Greg Thelen <gthelen@google.com> Cc: Christoph Lameter <cl@linux.com> Cc: Pekka Enberg <penberg@kernel.org> Cc: David Rientjes <rientjes@google.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* don't put symlink bodies in pagecache into highmemAl Viro2015-12-081-3/+2
| | | | | | | | | | | | kmap() in page_follow_link_light() needed to go - allowing to hold an arbitrary number of kmaps for long is a great way to deadlocking the system. new helper (inode_nohighmem(inode)) needs to be used for pagecache symlinks inodes; done for all in-tree cases. page_follow_link_light() instrumented to yell about anything missed. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch befs long symlinks to page_symlink_operationsAl Viro2015-12-061-19/+22
| | | | | | just give them the right ->readpage()... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* Merge branch 'for-linus' of ↵Linus Torvalds2015-07-041-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull more vfs updates from Al Viro: "Assorted VFS fixes and related cleanups (IMO the most interesting in that part are f_path-related things and Eric's descriptor-related stuff). UFS regression fixes (it got broken last cycle). 9P fixes. fs-cache series, DAX patches, Jan's file_remove_suid() work" [ I'd say this is much more than "fixes and related cleanups". The file_table locking rule change by Eric Dumazet is a rather big and fundamental update even if the patch isn't huge. - Linus ] * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (49 commits) 9p: cope with bogus responses from server in p9_client_{read,write} p9_client_write(): avoid double p9_free_req() 9p: forgetting to cancel request on interrupted zero-copy RPC dax: bdev_direct_access() may sleep block: Add support for DAX reads/writes to block devices dax: Use copy_from_iter_nocache dax: Add block size note to documentation fs/file.c: __fget() and dup2() atomicity rules fs/file.c: don't acquire files->file_lock in fd_install() fs:super:get_anon_bdev: fix race condition could cause dev exceed its upper limitation vfs: avoid creation of inode number 0 in get_next_ino namei: make set_root_rcu() return void make simple_positive() public ufs: use dir_pages instead of ufs_dir_pages() pagemap.h: move dir_pages() over there remove the pointless include of lglock.h fs: cleanup slight list_entry abuse xfs: Correctly lock inode when removing suid and file capabilities fs: Call security_ops->inode_killpriv on truncate fs: Provide function telling whether file_remove_privs() will do anything ...
| * fs: cleanup slight list_entry abuseRasmus Villemoes2015-06-231-1/+1
| | | | | | | | | | | | | | | | | | list_entry is just a wrapper for container_of, but it is arguably wrong (and slightly confusing) to use it when the pointed-to struct member is not a struct list_head. Use container_of directly instead. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | fs/befs/btree.c: remove unneeded initializationsFabian Frederick2015-06-251-3/+3
|/ | | | | | | | | bh, od_sup and this_node are unconditionally initialized in befs_bt_read_super() and befs_btree_find() Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* don't pass nameidata to ->follow_link()Al Viro2015-05-101-2/+2
| | | | | | | its only use is getting passed to nd_jump_link(), which can obtain it from current->nameidata Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* new ->follow_link() and ->put_link() calling conventionsAl Viro2015-05-101-19/+16
| | | | | | | | | | | | | | | | | | | a) instead of storing the symlink body (via nd_set_link()) and returning an opaque pointer later passed to ->put_link(), ->follow_link() _stores_ that opaque pointer (into void * passed by address by caller) and returns the symlink body. Returning ERR_PTR() on error, NULL on jump (procfs magic symlinks) and pointer to symlink body for normal symlinks. Stored pointer is ignored in all cases except the last one. Storing NULL for opaque pointer (or not storing it at all) means no call of ->put_link(). b) the body used to be passed to ->put_link() implicitly (via nameidata). Now only the opaque pointer is. In the cases when we used the symlink body to free stuff, ->follow_link() now should store it as opaque pointer in addition to returning it. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* befs: switch to simple_follow_link()Al Viro2015-05-101-19/+5
| | | | | Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>