aboutsummaryrefslogtreecommitdiff
path: root/fs
AgeCommit message (Collapse)AuthorFilesLines
2019-07-04btrfs: migrate the delayed refs rsv codeJosef Bacik4-183/+184
These belong with the delayed refs related code, not in extent-tree.c. Signed-off-by: Josef Bacik <[email protected]> Signed-off-by: David Sterba <[email protected]>
2019-07-04btrfs: Evaluate io_tree in find_lock_delalloc_range()Goldwyn Rodrigues3-19/+19
Simplification. No point passing the tree variable when it can be evaluated from inode. The tests now use the io_tree from btrfs_inode as opposed to creating one. Signed-off-by: Goldwyn Rodrigues <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
2019-07-04gfs2: Remove unused gfs2_iomap_alloc argumentAndreas Gruenbacher1-5/+4
Remove the unused flags argument of gfs2_iomap_alloc. Signed-off-by: Andreas Gruenbacher <[email protected]>
2019-07-04xfs: allow single bulkstat of special inodesDarrick J. Wong2-1/+31
Create a new bulk ireq flag that enables userspace to ask us for a special inode number instead of interpreting @ino as a literal inode number. This enables us to query the root inode easily. The reason for adding the ability to query specifically the root directory inode is that certain programs (xfsdump and xfsrestore) want to confirm when they've been pointed to the root directory. The userspace code assumes the root directory is always the first result from calling bulkstat with lastino == 0, but this isn't true if the (initial btree roots + initial AGFL + inode alignment padding) is itself long enough to be allocated to new inodes if all of those blocks should happen to be free at the same time. Rather than make userspace guess at internal filesystem state, we provide a direct query. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Allison Collins <[email protected]> Reviewed-by: Brian Foster <[email protected]>
2019-07-04xfs: specify AG in bulk reqDarrick J. Wong7-12/+69
Add a new xfs_bulk_ireq flag to constrain the iteration to a single AG. If the passed-in startino value is zero then we start with the first inode in the AG that the user passes in; otherwise, we iterate only within the same AG as the passed-in inode. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Allison Collins <[email protected]> Reviewed-by: Brian Foster <[email protected]>
2019-07-04orangefs: fix build warning from debugfs cleanup patchGreg Kroah-Hartman3-21/+6
Stephen writes: After merging the driver-core tree, today's linux-next build (x86_64 allmodconfig) produced this warning: fs/orangefs/orangefs-debugfs.c: In function 'orangefs_debugfs_init': fs/orangefs/orangefs-debugfs.c:193:1: warning: label 'out' defined but not used [-Wunused-label] out: ^~~ fs/orangefs/orangefs-debugfs.c: In function 'orangefs_kernel_debug_init': fs/orangefs/orangefs-debugfs.c:204:17: warning: unused variable 'ret' [-Wunused-variable] struct dentry *ret; ^~~ Fix this up and change the return type of the function to void as it can not fail, which cleans up some more code and variables as well. Cc: Mike Marshall <[email protected]> Cc: Martin Brandenburg <[email protected]> Cc: [email protected] Reported-by: Stephen Rothwell <[email protected]> Fixes: f095adba36bb ("orangefs: no need to check return value of debugfs_create functions") Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-07-04ubifs: fix build warning after debugfs cleanup patchGreg Kroah-Hartman1-1/+1
Stephen writes: After merging the driver-core tree, today's linux-next build (arm multi_v7_defconfig) produced this warning: fs/ubifs/debug.c: In function 'dbg_debugfs_init_fs': fs/ubifs/debug.c:2812:6: warning: unused variable 'err' [-Wunused-variable] int err, n; ^~~ So fix this up properly. Reported-by: Stephen Rothwell <[email protected]> Cc: Richard Weinberger <[email protected]> Cc: Artem Bityutskiy <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-07-03xfs: wire up the v5 inumbers ioctlDarrick J. Wong4-0/+62
Wire up the v5 INUMBERS ioctl. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Brian Foster <[email protected]>
2019-07-03xfs: wire up new v5 bulkstat ioctlsDarrick J. Wong4-1/+123
Wire up the new v5 BULKSTAT ioctl. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Brian Foster <[email protected]>
2019-07-03xfs: introduce v5 inode group structureDarrick J. Wong7-9/+42
Introduce a new "v5" inode group structure that fixes the alignment and padding problems of the existing structure. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Brian Foster <[email protected]>
2019-07-03xfs: introduce new v5 bulkstat structureDarrick J. Wong9-30/+125
Introduce a new version of the in-core bulkstat structure that supports our new v5 format features. This structure also fills the gaps in the previous structure. We leave wiring up the ioctls for the next patch. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Allison Collins <[email protected]> Reviewed-by: Brian Foster <[email protected]>
2019-07-03xfs: rename bulkstat functionsDarrick J. Wong3-18/+19
Rename the bulkstat functions to 'fsbulkstat' so that they match the ioctl names. We will be introducing a new set of bulkstat/inumbers ioctls soon, and it will be important to keep the names straight. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Allison Collins <[email protected]> Reviewed-by: Brian Foster <[email protected]>
2019-07-03xfs: remove various bulk request typedef usageDarrick J. Wong4-20/+23
Remove xfs_bstat_t, xfs_fsop_bulkreq_t, xfs_inogrp_t, and similarly named compat typedefs. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Allison Collins <[email protected]> Reviewed-by: Brian Foster <[email protected]>
2019-07-03nfsd: decode implementation idJ. Bruce Fields4-12/+46
Decode the implementation ID and display in nfsd/clients/#/info. It may be help identify the client. It won't be used otherwise. (When this went into the protocol, I thought the implementation ID would be a slippery slope towards implementation-specific workarounds as with the http user-agent. But I guess I was wrong, the risk seems pretty low now.) Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03nfsd: create xdr_netobj_dup helperJ. Bruce Fields1-7/+4
Move some repeated code to a common helper. No change in behavior. Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03nfsd: allow forced expiration of NFSv4 clientsJ. Bruce Fields1-1/+69
NFSv4 clients are automatically expired and all their locks removed if they don't contact the server for a certain amount of time (the lease period, 90 seconds by default). There can still be situations where that's not enough, so allow userspace to force expiry by writing "expire\n" to the new nfsd/client/#/ctl file. (The generic "ctl" name is because I expect we may want to allow other operations on clients in the future.) The write will not return until the client is expired and all of its locks and other state removed. The fault injection code also provides a way of expiring clients, but it fails if there are any in-progress RPC's referencing the client. Also, its method of selecting a client to expire is a little more primitive--it uses an IP address, which can't always uniquely specify an NFSv4 client. Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03nfsd: create get_nfsdfs_clp helperJ. Bruce Fields1-8/+13
Factor our some common code. No change in behavior. Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03nfsd4: show layout stateidsJ. Bruce Fields1-0/+20
These are also minimal for now, I'm not sure what information would be useful. Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03nfsd: show lock and deleg stateidsJ. Bruce Fields1-0/+59
These entries are pretty minimal for now. Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03nfsd4: add file to display list of client's opensJ. Bruce Fields1-2/+147
Add a nfsd/clients/#/opens file to list some information about all the opens held by the given client, including open modes, device numbers, inode numbers, and open owners. Open owners are totally opaque but seem to sometimes have some useful ascii strings included, so passing through printable ascii characters and escaping the rest seems useful while still being machine-readable. Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03nfsd: add more information to client info fileJ. Bruce Fields1-0/+12
Add ip address, full client-provided identifier, and minor version. There's much more that could possibly be useful but this is a start. Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03nfsd: escape high characters in binary dataJ. Bruce Fields1-0/+11
I'm exposing some information about NFS clients in pseudofiles. I expect to eventually have simple tools to help read those pseudofiles. But it's also helpful if the raw files are human-readable to the extent possible. It aids debugging and makes them usable on systems that don't have the latest nfs-utils. A minor challenge there is opaque client-generated protocol objects like state owners and client identifiers. Some clients generate those to include handy information in plain ascii. But they may also include arbitrary byte sequences. I think the simplest approach is to limit to isprint(c) && isascii(c) and escape everything else. That means you can just cat the file and get something that looks OK. Also, I'm trying to keep these files legal YAML, which requires them to UTF-8, and this is a simple way to guarantee that. Acked-by: Kees Cook <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03nfsd: copy client's address including port number to cl_addrJ. Bruce Fields1-1/+1
rpc_copy_addr() copies only the IP address and misses any port numbers. It seems potentially useful to keep the port number around too. Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03nfsd4: add a client info fileJ. Bruce Fields3-8/+148
Add a new nfsd/clients/#/info file with some basic information about each NFSv4 client. Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03nfsd: make client/ directory names small intsJ. Bruce Fields3-3/+5
We want clientid's on the wire to be randomized for reasons explained in ebd7c72c63ac "nfsd: randomize SETCLIENTID reply to help distinguish servers". But I'd rather have mostly small integers for the clients/ directory. Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03nfsd: add nfsd/clients directoryJ. Bruce Fields5-10/+133
I plan to expose some information about nfsv4 clients here. Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03nfsd4: use reference count to free clientJ. Bruce Fields2-5/+22
Keep a second reference count which is what is really used to decide when to free the client's memory. Next I'm going to add an nfsd/clients/ directory with a subdirectory for each NFSv4 client. File objects under nfsd/clients/ will hold these references. Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03nfsd: rename cl_refcountJ. Bruce Fields2-14/+14
Rename this to a more descriptive name: it counts the number of in-progress rpc's referencing this client. Next I'm going to add a second refcount with a slightly different use. Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03nfsd: persist nfsd filesystem across mountsJ. Bruce Fields2-0/+14
Keep around one internal mount of the nfsd filesystem so that we can add stuff to it when clients come and go, regardless of whether anyone has it mounted. Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03nfsd: fix cleanup of nfsd_reply_cache_init on failureJ. Bruce Fields1-3/+7
The failure to unregister the shrinker results will result in corruption when the nfsd_net is freed. Also clean up the drc_slab while we're here. Reported-by: [email protected] Fixes: db17b61765c2 ("nfsd4: drc containerization") Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03nfsd4: remove outdated nfsd4_decode_time commentJ. Bruce Fields1-4/+0
Commit bf8d909705e "nfsd: Decode and send 64bit time values" fixed the code without updating the comment. Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03nfsd: use 64-bit seconds fields in nfsd v4 codeJ. Bruce Fields3-15/+8
After commit 95582b008388 "vfs: change inode times to use struct timespec64" there are spots in the NFSv4 decoding where we decode the protocol into a struct timeval and then convert that into a timeval64. That's unnecesary in the NFSv4 case since the on-the-wire protocol also uses 64-bit values. So just fix up our code to use timeval64 everywhere. Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03nfsd: Spelling s/EACCESS/EACCES/Geert Uytterhoeven1-1/+1
The correct spelling is EACCES: include/uapi/asm-generic/errno-base.h:#define EACCES 13 /* Permission denied */ Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03lockd: Make two symbols staticYueHaibing2-2/+2
Fix sparse warnings: fs/lockd/clntproc.c:57:6: warning: symbol 'nlmclnt_put_lockowner' was not declared. Should it be static? fs/lockd/svclock.c:409:35: warning: symbol 'nlmsvc_lock_ops' was not declared. Should it be static? Reported-by: Hulk Robot <[email protected]> Signed-off-by: YueHaibing <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03locks: Cleanup lm_compare_owner and lm_owner_keyBenjamin Coddington1-5/+0
After the update to use nlm_lockowners for the NLM server, there are no more users of lm_compare_owner and lm_owner_key. Signed-off-by: Benjamin Coddington <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03lockd: Show pid of lockd for remote locksBenjamin Coddington5-6/+4
Use the pid of lockd instead of the remote lock's svid for the fl_pid for local POSIX locks. This allows proper enumeration of which local process owns which lock. The svid is meaningless to local lock readers. Signed-off-by: Benjamin Coddington <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03lockd: Remove lm_compare_owner and lm_owner_keyBenjamin Coddington1-18/+0
Now that the NLM server allocates an nlm_lockowner for fl_owner, there's no need for special hashing or comparison. Signed-off-by: Benjamin Coddington <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03lockd: Convert NLM service fl_owner to nlm_lockownerBenjamin Coddington6-5/+121
Do as the NLM client: allocate and track a struct nlm_lockowner for use as the fl_owner for locks created by the NLM sever. This allows us to keep the svid within this structure for matching locks, and will allow us to track the pid of lockd in a future patch. It should also allow easier reference of the nlm_host in conflicting locks, and simplify lock hashing and comparison. Signed-off-by: Benjamin Coddington <[email protected]> [[email protected]: fix type of some error returns] Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03lockd: prepare nlm_lockowner for use by the serverBenjamin Coddington1-10/+11
The nlm_lockowner structure that the client uses to track locks is generally useful to the server as well. Very similar functions to handle allocation and tracking of the nlm_lockowner will follow. Rename the client functions for clarity. Signed-off-by: Benjamin Coddington <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03nfsd: note inadequate stats lockingJ. Bruce Fields1-2/+5
After 89a26b3d295d "nfsd: split DRC global spinlock into per-bucket locks", there is no longer a single global spinlock to protect these stats. So, really we need to fix that. For now, at least fix the comment. Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03nfsd4: drc containerizationJ. Bruce Fields4-125/+154
The nfsd duplicate reply cache should not be shared between network namespaces. The most straightforward way to fix this is just to move every global in the code to per-net-namespace memory, so that's what we do. Still todo: sort out which members of nfsd_stats should be global and which per-net-namespace. Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03nfsd: don't call nfsd_reply_cache_shutdown twiceJ. Bruce Fields1-1/+0
The caller is cleaning up on ENOMEM, don't try to do it here too. Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03nfsd: Fix overflow causing non-working mounts on 1 TB machinesPaul Menzel1-1/+1
Since commit 10a68cdf10 (nfsd: fix performance-limiting session calculation) (Linux 5.1-rc1 and 4.19.31), shares from NFS servers with 1 TB of memory cannot be mounted anymore. The mount just hangs on the client. The gist of commit 10a68cdf10 is the change below. -avail = clamp_t(int, avail, slotsize, avail/3); +avail = clamp_t(int, avail, slotsize, total_avail/3); Here are the macros. #define min_t(type, x, y) __careful_cmp((type)(x), (type)(y), <) #define clamp_t(type, val, lo, hi) min_t(type, max_t(type, val, lo), hi) `total_avail` is 8,434,659,328 on the 1 TB machine. `clamp_t()` casts the values to `int`, which for 32-bit integers can only hold values −2,147,483,648 (−2^31) through 2,147,483,647 (2^31 − 1). `avail` (in the function signature) is just 65536, so that no overflow was happening. Before the commit the assignment would result in 21845, and `num = 4`. When using `total_avail`, it is causing the assignment to be 18446744072226137429 (printed as %lu), and `num` is then 4164608182. My next guess is, that `nfsd_drc_mem_used` is then exceeded, and the server thinks there is no memory available any more for this client. Updating the arguments of `clamp_t()` and `min_t()` to `unsigned long` fixes the issue. Now, `avail = 65536` (before commit 10a68cdf10 `avail = 21845`), but `num = 4` remains the same. Fixes: c54f24e338ed (nfsd: fix performance-limiting session calculation) Cc: [email protected] Signed-off-by: Paul Menzel <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2019-07-03f2fs: support swap file w/ DIOJaegeuk Kim2-10/+137
Signed-off-by: Jaegeuk Kim <[email protected]>
2019-07-03fs: xfs: xfs_log: Change return type from int to voidHariprasad Kelam4-17/+7
Change return types of below functions as they never fails xfs_log_mount_cancel xlog_recover_cancel xlog_recover_cancel_intents fix below issue reported by coccicheck fs/xfs/xfs_log_recover.c:4886:7-12: Unneeded variable: "error". Return "0" on line 4926 Signed-off-by: Hariprasad Kelam <[email protected]> Reviewed-by: Eric Sandeen <[email protected]> Reviewed-by: Carlos Maiolino <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Darrick J. Wong <[email protected]>
2019-07-03xfs: poll waiting for quotacheckDarrick J. Wong5-2/+28
Create a pwork destroy function that uses polling instead of uninterruptible sleep to wait for work items to finish so that we can touch the softlockup watchdog. IOWs, gross hack. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Brian Foster <[email protected]>
2019-07-03ceph: no need to check return value of debugfs_create functionsGreg Kroah-Hartman3-26/+4
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. This cleanup allows the return value of the functions to be made void, as no logic should care if these files succeed or not. Cc: "Yan, Zheng" <[email protected]> Cc: Sage Weil <[email protected]> Cc: Ilya Dryomov <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-07-03ubifs: no need to check return value of debugfs_create functionsGreg Kroah-Hartman3-135/+45
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: Richard Weinberger <[email protected]> Cc: Artem Bityutskiy <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-07-03orangefs: no need to check return value of debugfs_create functionsGreg Kroah-Hartman1-31/+4
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: Mike Marshall <[email protected]> Cc: Martin Brandenburg <[email protected]> Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-07-03nfsd: no need to check return value of debugfs_create functionsGreg Kroah-Hartman3-16/+5
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: "J. Bruce Fields" <[email protected]> Cc: Jeff Layton <[email protected]> Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>