- 28 6月, 2021 1 次提交
-
-
由 Andreas Gruenbacher 提交于
Commit 88b631cb ("gfs2: convert to fileattr") changed the argument list without updating the description. Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
-
- 02 6月, 2021 1 次提交
-
-
由 Andreas Gruenbacher 提交于
This reverts commit b7f55d92. As explained by Linus in [*], write faults on a mmap region are reads from a filesysten point of view, so taking the inode glock exclusively on write faults is incorrect. Instead, when a page is marked writable, the .page_mkwrite vm operation will be called, which is where the exclusive lock taking needs to happen. I got this wrong because of a broken test case that made me believe .page_mkwrite isn't getting called when it actually is. [*] https://lore.kernel.org/lkml/CAHk-=wj8EWr_D65i4oRSj2FTbrc6RdNydNNCGxeabRnwtoU=3Q@mail.gmail.com/Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
-
- 21 5月, 2021 1 次提交
-
-
由 Andreas Gruenbacher 提交于
When a write fault occurs, we need to take the inode glock of the underlying inode in exclusive mode. Otherwise, there's no guarantee that the dirty page will be written back to disk. Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
-
- 20 5月, 2021 1 次提交
-
-
由 Andreas Gruenbacher 提交于
When a direct I/O write falls entirely and falls back to buffered I/O and the buffered I/O fails, the write failed with return value 0 instead of the error number reported by the buffered I/O. Fix that. Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
-
- 12 4月, 2021 1 次提交
-
-
由 Miklos Szeredi 提交于
Use the fileattr API to let the VFS handle locking, permission checking and conversion. Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com> Cc: Andreas Gruenbacher <agruenba@redhat.com>
-
- 10 4月, 2021 1 次提交
-
-
由 Lee Jones 提交于
Building the kernel with W=1 results in a number of kernel-doc warnings like incorrect function names and parameter descriptions. Fix those, mostly by adding missing parameter descriptions, removing left-over descriptions, and demoting some less important kernel-doc comments into regular comments. Originally proposed by Lee Jones; improved and combined into a single patch by Andreas. Signed-off-by: NLee Jones <lee.jones@linaro.org> Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
-
- 04 4月, 2021 1 次提交
-
-
由 Andreas Gruenbacher 提交于
Rename the current gfs2_iomap_get and gfs2_iomap_alloc functions to __*. Add a new gfs2_iomap_get helper that doesn't expose struct metapath. Rename gfs2_iomap_get_alloc to gfs2_iomap_alloc. Use the new helpers where they make sense. Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
-
- 18 2月, 2021 2 次提交
-
-
由 Andreas Gruenbacher 提交于
Add a rs_reserved field to struct gfs2_blkreserv to keep track of the number of blocks reserved by this particular reservation, and a rd_reserved field to struct gfs2_rgrpd to keep track of the total number of reserved blocks in the resource group. Those blocks are exclusively reserved, as opposed to the rs_requested / rd_requested blocks which are tracked in the reservation tree (rd_rstree) and which can be stolen if necessary. When making a reservation with gfs2_inplace_reserve, rs_reserved is set to somewhere between ap->min_target and ap->target depending on the number of free blocks in the resource group. When allocating blocks with gfs2_alloc_blocks, rs_reserved is decremented accordingly. Eventually, any reserved but not consumed blocks are returned to the resource group by gfs2_inplace_release. Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
-
由 Andreas Gruenbacher 提交于
In gfs2_release, check if the inode has an active reservation to avoid unnecessary lock taking. Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
-
- 24 1月, 2021 3 次提交
-
-
由 Christian Brauner 提交于
Extend some inode methods with an additional user namespace argument. A filesystem that is aware of idmapped mounts will receive the user namespace the mount has been marked with. This can be used for additional permission checking and also to enable filesystems to translate between uids and gids if they need to. We have implemented all relevant helpers in earlier patches. As requested we simply extend the exisiting inode method instead of introducing new ones. This is a little more code churn but it's mostly mechanical and doesnt't leave us with additional inode methods. Link: https://lore.kernel.org/r/20210121131959.646623-25-christian.brauner@ubuntu.com Cc: Christoph Hellwig <hch@lst.de> Cc: David Howells <dhowells@redhat.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: linux-fsdevel@vger.kernel.org Reviewed-by: NChristoph Hellwig <hch@lst.de> Signed-off-by: NChristian Brauner <christian.brauner@ubuntu.com>
-
由 Christian Brauner 提交于
The inode_owner_or_capable() helper determines whether the caller is the owner of the inode or is capable with respect to that inode. Allow it to handle idmapped mounts. If the inode is accessed through an idmapped mount it according to the mount's user namespace. Afterwards the checks are identical to non-idmapped mounts. If the initial user namespace is passed nothing changes so non-idmapped mounts will see identical behavior as before. Similarly, allow the inode_init_owner() helper to handle idmapped mounts. It initializes a new inode on idmapped mounts by mapping the fsuid and fsgid of the caller from the mount's user namespace. If the initial user namespace is passed nothing changes so non-idmapped mounts will see identical behavior as before. Link: https://lore.kernel.org/r/20210121131959.646623-7-christian.brauner@ubuntu.com Cc: Christoph Hellwig <hch@lst.de> Cc: David Howells <dhowells@redhat.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: linux-fsdevel@vger.kernel.org Reviewed-by: NChristoph Hellwig <hch@lst.de> Reviewed-by: NJames Morris <jamorris@linux.microsoft.com> Signed-off-by: NChristian Brauner <christian.brauner@ubuntu.com>
-
由 Christoph Hellwig 提交于
Pass a set of flags to iomap_dio_rw instead of the boolean wait_for_completion argument. The IOMAP_DIO_FORCE_WAIT flag replaces the wait_for_completion, but only needs to be passed when the iocb isn't synchronous to start with to simplify the callers. Signed-off-by: NChristoph Hellwig <hch@lst.de> Reviewed-by: NDave Chinner <dchinner@redhat.com> Reviewed-by: NBrian Foster <bfoster@redhat.com> [djwong: rework xfs_file.c so that we can push iomap changes separately] Reviewed-by: NDarrick J. Wong <djwong@kernel.org> Signed-off-by: NDarrick J. Wong <djwong@kernel.org>
-
- 14 1月, 2021 1 次提交
-
-
由 Eric Biggers 提交于
The I_DIRTY_TIME flag is primary used within the VFS, and there's no reason for ->fsync() implementations to do anything with it. This is because when !datasync, the VFS will expire dirty timestamps before calling ->fsync(). (See vfs_fsync_range().) This turns I_DIRTY_TIME into I_DIRTY_SYNC. Therefore, change gfs2_fsync() to not check for I_DIRTY_TIME. Link: https://lore.kernel.org/r/20210112190253.64307-11-ebiggers@kernel.orgReviewed-by: NChristoph Hellwig <hch@lst.de> Reviewed-by: NJan Kara <jack@suse.cz> Signed-off-by: NEric Biggers <ebiggers@google.com> Signed-off-by: NJan Kara <jack@suse.cz>
-
- 06 8月, 2020 1 次提交
-
-
由 Christoph Hellwig 提交于
Failing to invalid the page cache means data in incoherent, which is a very bad state for the system. Always fall back to buffered I/O through the page cache if we can't invalidate mappings. Signed-off-by: NChristoph Hellwig <hch@lst.de> Acked-by: NDave Chinner <dchinner@redhat.com> Reviewed-by: NGoldwyn Rodrigues <rgoldwyn@suse.com> Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com> Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com> Acked-by: NBob Peterson <rpeterso@redhat.com> Acked-by: NDamien Le Moal <damien.lemoal@wdc.com> Reviewed-by: Theodore Ts'o <tytso@mit.edu> # for ext4 Reviewed-by: Andreas Gruenbacher <agruenba@redhat.com> # for gfs2 Reviewed-by: NRitesh Harjani <riteshh@linux.ibm.com>
-
- 03 8月, 2020 1 次提交
-
-
由 Andreas Gruenbacher 提交于
Pass a pointer to the existing glock holder from gfs2_file_{read,write}_iter to gfs2_file_direct_{read,write} to save some stack space. Suggested-by: NMatthew Wilcox <willy@infradead.org> Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
-
- 08 7月, 2020 1 次提交
-
-
由 Andreas Gruenbacher 提交于
So far, gfs2 has taken the inode glocks inside the ->readpage and ->readahead address space operations. Since commit d4388340 ("fs: convert mpage_readpages to mpage_readahead"), gfs2_readahead is passed the pages to read ahead locked. With that, the current holder of the inode glock may be trying to lock one of those pages while gfs2_readahead is trying to take the inode glock, resulting in a deadlock. Fix that by moving the lock taking to the higher-level ->read_iter file and ->fault vm operations. This also gets rid of an ugly lock inversion workaround in gfs2_readpage. The cache consistency model of filesystems like gfs2 is such that if data is found in the page cache, the data is up to date and can be used without taking any filesystem locks. If a page is not cached, filesystem locks must be taken before populating the page cache. To avoid taking the inode glock when the data is already cached, gfs2_file_read_iter first tries to read the data with the IOCB_NOIO flag set. If that fails, the inode glock is taken and the operation is retried with the IOCB_NOIO flag cleared. Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
-
- 28 3月, 2020 4 次提交
-
-
由 Andreas Gruenbacher 提交于
We now get the quota data structure when opening a file writable and put it when closing that writable file descriptor, so there no longer is a need for gfs2_qa_{get,put} while we're holding a writable file descriptor. Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com> Signed-off-by: NBob Peterson <rpeterso@redhat.com>
-
由 Andreas Gruenbacher 提交于
Keeping reservations and quotas separate helps reviewing the code. Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com> Signed-off-by: NBob Peterson <rpeterso@redhat.com>
-
由 Bob Peterson 提交于
Before this patch, multiple users called gfs2_qa_alloc which allocated a qadata structure to the inode, if quotas are turned on. Later, in file close or evict, the structure was deleted with gfs2_qa_delete. But there can be several competing processes who need access to the structure. There were races between file close (release) and the others. Thus, a release could delete the structure out from under a process that relied upon its existence. For example, chown. This patch changes the management of the qadata structures to be a get/put scheme. Function gfs2_qa_alloc has been changed to gfs2_qa_get and if the structure is allocated, the count essentially starts out at 1. Function gfs2_qa_delete has been renamed to gfs2_qa_put, and the last guy to decrement the count to 0 frees the memory. Signed-off-by: NBob Peterson <rpeterso@redhat.com>
-
由 Bob Peterson 提交于
Before this patch, multiple callers called gfs2_rsqa_alloc to force the existence of a reservations structure and a quota data structure if needed. However, now the reservations are handled separately, so the quota data is only the quota data. So we eliminate the one in favor of just calling gfs2_qa_alloc directly. Signed-off-by: NBob Peterson <rpeterso@redhat.com>
-
- 07 2月, 2020 2 次提交
-
-
由 Andreas Gruenbacher 提交于
In gfs2_file_write_iter, for direct writes, the error checking in the buffered write fallback case is incomplete. This can cause inode write errors to go undetected. Fix and clean up gfs2_file_write_iter along the way. Based on a proposed fix by Christoph Hellwig <hch@lst.de>. Fixes: 967bcc91 ("gfs2: iomap direct I/O support") Cc: stable@vger.kernel.org # v4.19+ Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
-
由 Christoph Hellwig 提交于
Set current->backing_dev_info just around the buffered write calls to prepare for the next fix. Fixes: 967bcc91 ("gfs2: iomap direct I/O support") Cc: stable@vger.kernel.org # v4.19+ Signed-off-by: NChristoph Hellwig <hch@lst.de> Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
-
- 15 11月, 2019 1 次提交
-
-
由 Bob Peterson 提交于
Add function gfs2_withdrawn and replace all checks for the SDF_WITHDRAWN bit to call it. This does not change the logic or function of gfs2, and it facilitates later improvements to the withdraw sequence. Signed-off-by: NBob Peterson <rpeterso@redhat.com> Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
-
- 08 11月, 2019 2 次提交
-
-
由 Andreas Gruenbacher 提交于
When the filesystem block size is smaller than the page size, the last page may contain blocks that lie entirely beyond the end of the file. Make sure to only allocate blocks that lie at least partially in the file. Allocating blocks beyond that isn't useful, and what's more, they will not be zeroed out and may end up containing random data. With that change in place, make sure we'll still always unstuff stuffed inodes: iomap_writepage and iomap_writepages currently can't handle stuffed files. In addition, simplify and move the end-of-file check further to the top in gfs2_page_mkwrite to avoid weird side effects like unstuffing when we're not. Fixes xfstest generic/263. Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
-
由 Andreas Gruenbacher 提交于
In gfs2_page_mkwrite's gfs2_allocate_page_backing helper, try to allocate as many blocks at once as we need. Pass in the size of the requested allocation. Fixes: 35af80ae ("gfs2: don't use buffer_heads in gfs2_allocate_page_backing") Cc: stable@vger.kernel.org # v5.3+ Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
-
- 30 10月, 2019 1 次提交
-
-
由 Andreas Gruenbacher 提交于
Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
-
- 23 10月, 2019 1 次提交
-
-
由 Arnd Bergmann 提交于
Out of the four ioctl commands supported on gfs2, only FITRIM works in compat mode. Add a proper handler based on the ext4 implementation. Fixes: 6ddc5c3d ("gfs2: getlabel support") Reviewed-by: NBob Peterson <rpeterso@redhat.com> Cc: Andreas Gruenbacher <agruenba@redhat.com> Signed-off-by: NArnd Bergmann <arnd@arndb.de>
-
- 15 10月, 2019 1 次提交
-
-
由 Jan Kara 提交于
Filesystems do not support doing IO as asynchronous in some cases. For example in case of unaligned writes or in case file size needs to be extended (e.g. for ext4). Instead of forcing filesystem to wait for AIO in such cases, add argument to iomap_dio_rw() which makes the function wait for IO completion. This also results in executing iomap_dio_complete() inline in iomap_dio_rw() providing its return value to the caller as for ordinary sync IO. Signed-off-by: NJan Kara <jack@suse.cz> Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com> Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
-
- 05 9月, 2019 1 次提交
-
-
由 Andreas Gruenbacher 提交于
Replace divisions by PAGE_SIZE with shifts by PAGE_SHIFT and similar. Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
-
- 03 9月, 2019 1 次提交
-
-
由 Andreas Gruenbacher 提交于
When allocating space with fallocate, always update the file timestamps and mark the inode dirty, no matter if the FALLOC_FL_KEEP_SIZE flag is set or not. The inode needs to be marked dirty so that a subsequent fsync will pick it up and any new allocations will make it to disk. Filesystems like xfs and ext4 always update the timestamps, so make gfs2 behave the same way. Fixes xfstest generic/483. Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
-
- 03 7月, 2019 2 次提交
-
-
由 Christoph Hellwig 提交于
Rewrite gfs2_allocate_page_backing to call gfs2_iomap_get_alloc and operate on struct iomap directly. Signed-off-by: NChristoph Hellwig <hch@lst.de> Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
-
由 Christoph Hellwig 提交于
Without casting page->index to a guaranteed 64-bit type, the value might be treated as 32-bit on 32-bit platforms and thus get truncated. Signed-off-by: NChristoph Hellwig <hch@lst.de> Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
-
- 01 7月, 2019 1 次提交
-
-
由 Darrick J. Wong 提交于
Create a generic function to check incoming FS_IOC_SETFLAGS flag values and later prepare the inode for updates so that we can standardize the implementations that follow ext4's flag values. Note that the efivarfs implementation no longer fails a no-op SETFLAGS without CAP_LINUX_IMMUTABLE since that's the behavior in ext*. Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com> Reviewed-by: NJan Kara <jack@suse.cz> Reviewed-by: NChristoph Hellwig <hch@lst.de> Acked-by: NDavid Sterba <dsterba@suse.com> Reviewed-by: NBob Peterson <rpeterso@redhat.com>
-
- 28 6月, 2019 1 次提交
-
-
由 Bob Peterson 提交于
Before this patch, the superblock flag indicating when a file system is withdrawn was called SDF_SHUTDOWN. This patch simply renames it to the more obvious SDF_WITHDRAWN. Signed-off-by: NBob Peterson <rpeterso@redhat.com> Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
-
- 05 6月, 2019 1 次提交
-
-
由 Thomas Gleixner 提交于
Based on 1 normalized pattern(s): this copyrighted material is made available to anyone wishing to use modify copy or redistribute it subject to the terms and conditions of the gnu general public license version 2 extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 44 file(s). Signed-off-by: NThomas Gleixner <tglx@linutronix.de> Reviewed-by: NAllison Randal <allison@lohutok.net> Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190531081038.653000175@linutronix.deSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 24 2月, 2019 1 次提交
-
-
由 Christoph Hellwig 提交于
Store the request queue the last bio was submitted to in the iocb private data in addition to the cookie so that we find the right block device. Also refactor the common direct I/O bio submission code into a nice little helper. Signed-off-by: NChristoph Hellwig <hch@lst.de> Modified to use bio_set_polled(). Reviewed-by: NHannes Reinecke <hare@suse.com> Signed-off-by: NJens Axboe <axboe@kernel.dk>
-
- 01 12月, 2018 1 次提交
-
-
由 NeilBrown 提交于
Rather than assuming all-zeros is sufficient, use the available API to initialize the file_lock structure use for unlock. VFS-level changes will soon make it important that the list_heads in file_lock are always properly initialized. Signed-off-by: NNeilBrown <neilb@suse.com> Reviewed-by: NJ. Bruce Fields <bfields@redhat.com> Signed-off-by: NJeff Layton <jlayton@kernel.org>
-
- 12 10月, 2018 1 次提交
-
-
由 Andreas Gruenbacher 提交于
Move the rs_sizehint and rs_rgd_gh fields from struct gfs2_blkreserv into the inode: they are more closely related to the inode than to a particular reservation. Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com> Signed-off-by: NBob Peterson <rpeterso@redhat.com> Reviewed-by: NSteven Whitehouse <swhiteho@redhat.com>
-
- 09 10月, 2018 1 次提交
-
-
由 Steve Whitehouse 提交于
Add support for the GETFSLABEL ioctl in gfs2. I tested this patch and it works as expected. Signed-off-by: NSteve Whitehouse <swhiteho@redhat.com> Tested-by: NAbhi Das <adas@redhat.com> Signed-off-by: NBob Peterson <rpeterso@redhat.com>
-
- 25 7月, 2018 1 次提交
-
-
由 Andreas Gruenbacher 提交于
Remove the fallback code from direct to buffered I/O for stuffed reads. For stuffed writes, we must keep the fallback code: the deferred glock we are holding under direct I/O doesn't allow to write to the inode or change the file size. Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com> Reviewed-by: NBob Peterson <rpeterso@redhat.com>
-