2018-10-19 |
fs: devfs: implement d_revalidate hook
...
The files in devfs can change withouut the fs layer noticing, so we
have to revalidate dentries before using them.
A failure could be triggered with:
ls /dev/nand0.root.ubi; ubiattach /dev/nand0.root; ls /dev/nand0.root.ubi
The first 'ls' would create a dentry for nand0.root.ubi with no inode
associated since it does not yet exist. 'ubiattach' then creates that
file, but the second 'ls' does not show it since the dentry is not
revalidated and thus no inode is added to that dentry. This patch
fixes this and also the opposite case when a file is removed (for
example with ubidetach).
Reported-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 19 Oct 2018
|
fs: implement d_revalidate
...
d_revalidate is useful when filesystems change under the hood of the
fs layer. This can happen with network filesystems or with devfs.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 19 Oct 2018
|
2018-09-28 |
fs: ubifs: Do not free memory not allocated by ubifs
...
Since the switch to dentry cache implementation we no longer allocate
the super block, so we must not free it in the error path.
Fixes: ("4d2b23bcf9 fs: ubifs: Switch to dentry cache implementation")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 28 Sep 2018
|
2018-09-26 |
fs: stat: Do not forget to set errno
...
stat() needs to set errno correctly when returning with an error.
Fixes: b3fbfad7ae ("fs: dentry cache implementation")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 26 Sep 2018
|
fs: open: Do not forget to set errno
...
When the initial lookup fails in open we have to go to the error path
which sets errno correctly rather than returning directly.
Fixes: b3fbfad7ae ("fs: dentry cache implementation")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 26 Sep 2018
|
2018-09-18 |
fs: devfs: fix r/w permissions
...
The real r/w flags were lost in the switch to dentry cache
implementation. Restore them.
Fixes: 9137c41915 ("fs: devfs: Switch to dentry cache implementation")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 18 Sep 2018
|
fs: devfs: Create device files as character devices
...
Without this files in /dev/ appear as regular files. copy_file()
stumbles upon this as it tries a truncate() on that files which
then fails. Create the files as character devices so that copy_file()
works as expected.
Fixes: 9137c41915 ("fs: devfs: Switch to dentry cache implementation")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Tested-by: Giorgio Dal Molin <giorgio.nicole@arcor.de>
Sascha Hauer
committed
on 18 Sep 2018
|
2018-09-10 |
fs: tftp: Use pr_debug for errors
...
This has been debug output before for good reasons. The users will
usually print the error messages when they want to.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 10 Sep 2018
|
2018-08-30 |
fs: tftp: improve file size handling
...
Previously we used FILE_SIZE_STREAM unconditionally. Instead, fill the
inode size with a valid filesize if we have one and only if not fall
back to FILE_SIZE_STREAM.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 30 Aug 2018
|
fs: tftp: hide files which are actually not present on the server
...
In tftp_lookup we claimed that every desired file is there. This leads
to problems when a user only tests if a file is present and makes
decisions upon this information. Rather than claiming that all files
are present do a tftp_do_open() on the files and see if it is really
there.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 30 Aug 2018
|
fs: tftp: fix return value
...
When tftp_get_inode() fails it is a sign for a out of memory situtation
rather than an indicator for no space left on the filesystem, so return
-ENOMEM.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 30 Aug 2018
|
fs: tftp: fix memory hole
...
dpath() returns a pointer to an allocated string, so we have to free it.
Put the pointer into our file private data and free it on close time.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 30 Aug 2018
|
fs: tftp: overhaul debugging
...
- use pr_* instead of debug()
- use pr_vdebug for the less interesting messages
- use pr_err for error messages
- print state as clear text and not as number
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 30 Aug 2018
|
2018-08-13 |
Merge branch 'for-next/memcmds'
Sascha Hauer
committed
on 13 Aug 2018
|
2018-08-10 |
fs: ramfs: get chunks zero initialized
...
Initialize new chunks to zero, otherwise a ->truncate call may
result in uninitialized data in files.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 10 Aug 2018
|
2018-07-13 |
fs: squashfs: Switch to dentry cache implementation
...
While at it implement symlink support.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 13 Jul 2018
|
fs: cramfs: Switch to dentry cache implementation
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 13 Jul 2018
|
fs: tftp: Switch to dentry cache implementation
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 13 Jul 2018
|
fs: nfs: Switch to dentry cache implementation
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 13 Jul 2018
|
fs: ubifs: Switch to dentry cache implementation
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 13 Jul 2018
|
2018-07-11 |
fs: ext4: Switch to dentry cache implementation
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 11 Jul 2018
|
fs: devfs: Switch to dentry cache implementation
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 11 Jul 2018
|
fs: ramfs: Switch to dentry cache implementation
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 11 Jul 2018
|
fs: dentry cache implementation
...
This adds the Linux dentry cache implementation to barebox.
Until now every filesystem driver resolves the full path to a file for
itself. This leads to code duplication and is error prone since
resolving paths is a complicated task. Also it can narrow down the
lookup performance since barebox only knows ASCII paths and has no way
of caching lookups.
With this patch we get the Linux dcache implementation. The path
resolving code from fs/namei.c is nearly taken as-is, minus the RCU
and locking code. Dcaching is made simple as of now: We simply cache
everything and never release any dentries. Although we do reference
counting for inodes and dentries it is effectively not used yet.
We never free anything until a fs is unmounted in which case we free
everything no matter if references are taken or not.
This patch also contains a wrapper in fs/legacy.c to support
filesystems with the old API.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 11 Jul 2018
|
2018-06-25 |
fs: devfs-core: Make use of devpath_to_name()
...
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Andrey Smirnov
authored
on 24 Jun 2018
Sascha Hauer
committed
on 25 Jun 2018
|
2018-06-14 |
fs: fix memory access via /dev/mem for MIPS64
...
lseek checks for non-negative in-memory offsets (addresses), failing otherwise.
However negative address 0xffffffffXXXXXXXX is a valid MIPS64 virtual address.
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Peter Mamonov
authored
on 13 Jun 2018
Sascha Hauer
committed
on 14 Jun 2018
|
2018-04-06 |
fs: Fix finding correct directory for mkdir/rmdir
...
When there are links in the path mkdir/rmdir are called with then
canonicalize_path is needed which resolves the links.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 6 Apr 2018
|
fs: Cleanup whitespace damage
...
fs.c has some whitespaces where there should be tabs. Fix it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 6 Apr 2018
|
fs: Move mem_write/mem_read to devfs-core
...
fs.c is already heavily filled with code. Move mem_write/mem_read
to devfs-core where it fits better.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 6 Apr 2018
|
fs: Add super_operations
...
Add a struct super_operations we can use later when we get a fs
implementation closer to Linux. Only add the functions we'll likely
need though.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 6 Apr 2018
|