summaryrefslogtreecommitdiffstats
path: root/sys/fs
Commit message (Collapse)AuthorAgeFilesLines
...
* Handle IOC_VOID special case of passing an integer IOCTL argument through CUSE.hselasky2016-07-061-1/+1
| | | | | Submitted by: Vladimir Kondratyev <wulf@cicgroup.ru> Approved by: re (gjb)
* Rewrite sigdeferstop(9) and sigallowstop(9) into more flexiblekib2016-06-261-6/+4
| | | | | | | | | | | | | framework allowing to set the suspension policy for the dynamic block. Extend the currently possible policies of stopping on interruptible sleeps and ignoring such sleeps by two more: do not suspend at interruptible sleeps, but interrupt them with either EINTR or ERESTART. Reviewed by: jilles Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Approved by: re (gjb)
* Clean other flags in ncl_inactive, only. Add comment explaining why otherkib2016-06-261-3/+14
| | | | | | | | | flags should be unset. Suggested and reviewed by: rmacklem Sponsored by: The FreeBSD Foundation MFC after: 12 days Approved by: re (gjb)
* Since VOP_INACTIVE() is not guaranteed to be called, all cleanupskib2016-06-251-24/+33
| | | | | | | | | | | executed by inactive methods, must be repeated on reclaim. In particular, unlink and free sillyrenamed vnode both on inactivation and reclaim. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Approved by: re (gjb)
* Do not access NFS data for reclaimed vnode.kib2016-06-191-4/+8
| | | | | | | Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (delphij)
* Another follow-up to r291460. Only access vp->v_rdev for VCHR vnodeskib2016-06-151-13/+20
| | | | | | | | | in devfs_reclaim(). Reported and tested by: pho Sponsored by: The FreeBSD Foundation Approved by: re (gjb) MFC after: 1 week
* Fix a style bug.kevlo2016-06-081-1/+1
|
* ext2fs: Stop dropping and reacquiring Giant around geom calls.pfg2016-06-071-12/+0
| | | | As in UFS r300366.
* nfs_clvfsops: Fix leading whitespace introduced in r299848cem2016-06-071-30/+30
| | | | | | Replace spaces with tabs. No functional change. Sponsored by: EMC / Isilon Storage Division
* nfs_clvfsops: Prevent strdup of stack garbage with bogus mount specscem2016-06-071-1/+2
| | | | | | | | | | | | | | If strlen(hostp) was zero, the stack array 'nam' would never be initialized before being strdup()ed. Fix this by initializing it to the empty string. It's possible some external condition makes this case impossible, in which case, an assertion instead of this workaround is appropriate. Introduced in r299848. Reported by: Coverity CID: 1355336 Sponsored by: EMC / Isilon Storage Division
* ext2fs: rearrange ext4_bmapext().pfg2016-06-071-17/+16
| | | | | | | While here assign error a bit later. Reviewed by: Damjan Jovanovich Obtained from: NetBSD
* ext2fs(5): Cosmetic cleanups, mostly to the ext4 code.pfg2016-06-073-16/+16
| | | | Obtained from: NetBSD
* ext2fs: cleanup generation number management.pfg2016-06-072-11/+3
| | | | | | | | | | | | | | Ext2/3/4 manages generation numbers differently than UFS so adopt some rules that should work well. When allocating a new inode, make sure we generate a "good" random value specifically avoiding zero. Don't interfere with the numbers that are already generated in the filesystem: ext2fs doesn't have the backwards compatibility issues where there were no generation numbers. Reviewed by: kevlo MFC after: 1 week
* Remove drop/reacquire of Giant around geom calls for cd9660 and udf.kib2016-05-222-12/+0
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
* arc4random() returns 0 to (2**32)−1, use an alternative to initializekevlo2016-05-222-2/+4
| | | | | | | | i_gen if it's zero rather than a divide by 2. With inputs from delphij, mckusick, rmacklem Reviewed by: mckusick
* Same as for UFS, remove drop/reacquire of Giant, and use si_mountpt askib2016-05-211-17/+13
| | | | | | | the mount semaphore. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
* Remove zero assignments in the cdev allocator. cdp memory iskib2016-05-211-5/+0
| | | | | | | requested with M_ZERO. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
* If a local (AF_LOCAL, AF_UNIX) socket creation (bind) is attemptedrmacklem2016-05-181-3/+4
| | | | | | | | | | | | on a fuse mounted file system, it will crash. Although it may be possible to make this work correctly, this patch avoids the crash in the meantime. I removed the MPASS(), since panicing for the FIFO case didn't make a lot of sense when it returns an error for the others. PR: 195000 Submitted by: henry.hu.sh@gmail.com (earlier version) MFC after: 2 weeks
* Comment fix: the getsockaddr() is actually meant here.glebius2016-05-181-3/+3
| | | | Reviewed by: rmacklem
* Silence down the "insmntque() failed" autofs error; it happenstrasz2016-05-171-1/+1
| | | | | | | on shutdown and is perfectly normal. MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Fix fuse for "cp" of a mode 0444 file to the file system.rmacklem2016-05-153-1/+24
| | | | | | | | | | | | | | | When "cp" of a file with read-only (mode 0444) to a fuse mounted file system was attempted it would fail with EACCES. This was because fuse would attempt to open the file WRONLY and the open would fail. This patch changes the fuse_vnop_open() to test for an extant read-write open and use that, if it is available. This makes the "cp" of a read-only file to the fuse mounted file system work ok. There are simpler ways to fix this than adding the fuse_filehandle_validrw() function, but this function is useful for future patches related to exporting a fuse filesystem via NFS. MFC after: 2 weeks
* Make it possible to reroot into NFS. This means one can havetrasz2016-05-151-8/+122
| | | | | | | | | | | | | | | | | eg an NFSv4 root over WiFi: boot from md_root (small rootfs image preloaded by loader(8)), setup WiFi, and then reroot into the actual root, over NFS. Note that it's currently limited to NFSv4, and due to problems with nfsuserd(8) it requres a workaround on the server side: one needs to set the vfs.nfsd.enable_stringtouid=1 sysctl and not run nfsuserd(8) on either the server or the client side. Reviewed by: rmacklem@ MFC after: 1 month Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6347
* Fix fuse so that stale buffer cache data isn't read.rmacklem2016-05-151-0/+2
| | | | | | | | | | When I/O on a file under fuse is switched from buffered to DIRECT_IO, it was possible to read stale (before a recent modification) data from the buffer cache. This patch invalidates the buffer cache for the file to fix this. PR: 194293 MFC after: 2 weeks
* Fix fuse to use DIRECT_IO when required.rmacklem2016-05-142-2/+23
| | | | | | | | | | | | | | When a file is opened write-only and a partial block was written, buffered I/O would try and read the whole block in. This would result in a hung thread, since there was no open (fuse filehandle) that allowed reading. This patch avoids the problem by forcing DIRECT_IO for this case. It also sets DIRECT_IO when the file system specifies the FN_DIRECTIO flag in its reply to the open. Tested by: nishida@asusa.net, freebsd@moosefs.com PR: 194293, 206238 MFC after: 2 weeks
* nfsd: Fix use-after-free in NFS4 lock test servicecem2016-05-121-2/+2
| | | | | | | | | Trivial use-after-free where stp was freed too soon in the non-error path. To fix, simply move its release to the end of the routine. Reported by: Coverity CID: 1006105 Sponsored by: EMC / Isilon Storage Division
* Use vfs_hash_ref(9) to eliminate LK_EXCLOTHER kludge. As akib2016-05-112-43/+13
| | | | | | | | | consequence, the nfs client override of VOP_LOCK1() is no longer needed. Reviewed and tested by: rmacklem Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Don't increment srvrpccnt[] for the NFSv4.1 operations.rmacklem2016-05-071-1/+6
| | | | | | | | | | | | | When support for NFSv4.1 was added to the NFS server, it broke the server rpc count stats, since newnfsstats.srvrpccnt[] doesn't have entries for the new NFSv4.1 operations. Without this patch, the code was incrementing bogus entries in newnfsstats for the new NFSv4.1 operations. This patch is an interim fix. The nfsstats structure needs to be updated and that will come in a future commit. Reported by: cem MFC after: 2 weeks
* nfsserver: minor spelling fix in comment.pfg2016-05-061-1/+1
| | | | No functional change.
* Give mountd -S priority over outstanding RPC requests when suspending the nfsd.rmacklem2016-05-061-0/+6
| | | | | | | | | | | | | | | It was reported via email that under certain heavy RPC loads long delays before the exports would be updated was observed when using "mountd -S". This patch reverses the priority between the exclusive lock request to suspend the nfsd threads and the shared lock request for performing RPCs. As such, when mountd attempts to suspend the nfsd threads, it gets priority over outstanding RPC requests to do this. I suspect that the case reported was an artificial test load, but this patch did fix the problem for the reporter. Reported and Tested by: josephlai@qnap.com MFC after: 2 weeks
* Add nid_namelen bounds check to nfssvc system callemaste2016-05-061-0/+4
| | | | | | | | | | | | This is only allowed by root and only used by the nfs daemon, which should not provide an incorrect value. However, it's still good practice to validate data provided by userland. PR: 206626 Reported by: CTurt <cturt@hardenedbsd.org> Reviewed by: rmacklem MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D6201
* Rationalize license numbering in fdescfs(5)emaste2016-04-303-3/+3
|
* sys: Make use of our rounddown() macro when sys/param.h is available.pfg2016-04-301-2/+2
| | | | No functional change.
* ANSIfy fdescfs(5)emaste2016-04-302-58/+13
|
* sys/fs: spelling fixes in comments.pfg2016-04-2915-21/+21
| | | | No functional change.
* fs/ext2fs: spelling fixes on comment.pfg2016-04-291-1/+1
| | | | No functional change.
* NFS: spelling fixes on comments.pfg2016-04-2911-26/+26
| | | | No funcional change.
* sys/devfs: unsign an index to prevent signed integer overflow.pfg2016-04-281-1/+1
| | | | | | | cdp_maxdirent in struct:cdev_priv is of type u_int. Use the same type for the corresponding index in devfs_revoke(). MFC after: 1 week
* msdosfs: Prevent buffer overflow when expanding win95 nameskp2016-04-262-9/+23
| | | | | | | | | | | | In win2unixfn() we expand Windows 95 style long names. In some cases that requires moving the data in the nbp->nb_buf buffer backwards to make room. That code failed to check for overflows, leading to a stack overflow in win2unixfn(). We now check for this event, and mark the entire conversion as failed in that case. This means we present the 8 character, dos style, name instead. PR: 204643 Differential Revision: https://reviews.freebsd.org/D6015
* sys: extend use of the howmany() macro when available.pfg2016-04-261-3/+2
| | | | | We have a howmany() macro in the <sys/param.h> header that is convenient to re-use as it makes things easier to read.
* ext2fs: make use of the howmany() macro when available.pfg2016-04-261-4/+4
| | | | | | | We have a howmany() macro in the <sys/param.h> header that is convenient to re-use as it makes things easier to read. MFC after: 2 weeks
* Allow the NFSv4 server to reply NFSERR_WRONGSEC for the SetClientID operation.rmacklem2016-04-231-0/+1
| | | | | | | | | | | | | It was reported via email that a Linux client couldn't do a Kerberized NFS mount when only "sec=krb5" was specified for the exports. The Linux client attempted a mount via krb5i and the server replied NFSERR_SERVERFAULT. Although NFSERR_WRONGSEC isn't listed as an error for SetClientID, I think it is the correct reply, so this patch enables that. I do not know if this fixes the mount attempt, but adding "krb5i" to the list of allowed security flavours does allow the mount to work. Reported by: joef@spectralogic.com MFC after: 2 weeks
* ext2_htree_release(): prevent signed integer overflow in a loop.pfg2016-04-231-1/+1
| | | | | | | | | | h_levels_num, as most data structs in ext2fs, is unsigned so the index that addresses it has to be unsigned as well. To get to overflow here we would probably be considering a degenerate case though. MFC after: 5 days
* Fix a LOR in the NFSv4.1 server.rmacklem2016-04-232-6/+6
| | | | | | | | | | | | | | | The ordering of acquisition of the state and session mutexes was reversed in two cases executed when an NFSv4.1 client created/freed a session. Since clients will typically do this only when mounting and dismounting, the likelyhood of causing a deadlock was low but possible. This can only occur for NFSv4.1 mounts, since the others do not use sessions. This was detected while testing the pNFS server/client where the client crashed during dismounting. The patch also reorders the unlocks, although that isn't necessary for correct operation. MFC after: 2 weeks
* sys: use our roundup2/rounddown2() macros when param.h is available.pfg2016-04-211-1/+1
| | | | | | | | | | rounddown2 tends to produce longer lines than the original code and when the code has a high indentation level it was not really advantageous to do the replacement. This tries to strike a balance between readability using the macros and flexibility of having the expressions, so not everything is converted.
* kernel: use our nitems() macro when it is available through param.h.pfg2016-04-192-3/+3
| | | | | | No functional change, only trivial cases are done in this sweep, Discussed in: freebsd-current
* fs misc: for pointers replace 0 with NULL.pfg2016-04-154-7/+7
| | | | | | Mostly cosmetical, no functional change. Found with devel/coccinelle.
* If the VOP_SETATTR() call that saves the exclusive create verifier failed,rmacklem2016-04-121-0/+10
| | | | | | | | | | | | the NFS server would leave the newly created vnode locked. This could result in a file system that would not unmount and processes wedged, waiting for the file to be unlocked. Since this VOP_SETATTR() never fails for most file systems, this bug doesn't normally manifest itself. I found it during testing of an exported GlusterFS file system, which can fail. This patch adds the vput() and changes the error to the correct NFS one. MFC after: 2 weeks
* Bruce Evans reported that there was a performance regression betweenrmacklem2016-04-112-4/+6
| | | | | | | | | | | | the old and new NFS clients. He did a good job of isolating the problem which was caused by the new NFS client not setting the post write mtime correctly. The new NFS client code was cloned from the old client, but was incorrect, because the mtime in the nfs vnode's cache wasn't yet updated. This patch fixes this problem. The patch also adds missing mutex locking. Reported and tested by: bde MFC after: 2 weeks
* ext2fs: replace 0 with NULL for pointers.pfg2016-04-111-1/+2
| | | | | | | | | While here do late initialization of ebap, similar as was done in UFS. Found with devel/coccinelle. MFC after: 2 weeks
* Cleanup unnecessary semicolons from the kernel.pfg2016-04-1018-46/+45
| | | | Found with devel/coccinelle.
OpenPOWER on IntegriCloud