* When resetting the file cache, use file_cache_disable() to remove
all pages, instead of calling file_cache_delete().
* Possible fix for #19656.
file_cache_delete doesn't actually delete the VMCache object, so when
file_cache_create() is called the returned file_cache_ref just points
to the same VMCache as before.
Change-Id: Ifba42b51c52f11980fd97212d0c3bdfdc1e55085
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9448
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
* Split the "is only cache user" logic from cut_area into
a helper routine.
* If we can't modify a cache in cut_area, then we can't modify
its commitment either, so add that to the check.
* If we didn't split the areas, then modifying the commitments
doesn't make sense and will cause problems, so move that logic
into the "modify cache" branch.
* Use the new helper routine in set_memory_protection rather than
checking only cache->temporary.
Combined with the previous commit, seems to fix#19624.
Like check_access_permissions() but for write_stat() hook instead
of access().
Basic logic copied from BFS, but with the UID/GID logic rewritten
to better conform to behavior on other OSes: notably, we allow
chown() requests that keep the UID the same to go through, same
as Linux seems to, which should fix#19666. We now also validate
that the GID is one of the current team's groups.
* When the DirectoryCache is updated, compare the new contents with
the old. If any of the old entries are obsolete, treat the
respective node as stale.
* Create FileSystem::TrashStaleNode() to avoid duplicating code.
* Possible fix for #19656.
This helps the client keep current with changes made to server files
by other users.
While the comparison will be slow for a large directory, it won't be
executed unless another user has changed the contents of a directory
since the last time the Haiku client read the directory.
Change-Id: I03e65aaaad5027c66b10265f2b4a21ed9d2b6744
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9445
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
We need to change all groups, not just the primary group.
Otherwise, other groups will be left intact, which may
include groups the new user doesn't have permissions for.
This way, we can't inadvertently end up in a state where the
window is deleted but some things are still attached to it.
Fixes#19662.
Change-Id: I3ce7b5ccffc8cf12670209f3023613b32e31c41c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9437
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: John Scipione <[email protected]>
That is, just add the supertype if it does not exist. Leave getting it
to the callers that need it.
Fixes: #19653
Change-Id: I79d804161d28684e16a0d84ec3a2fb6788c0b506
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9436
Reviewed-by: waddlesplash <[email protected]>
x86_64 already does this and it seems to work fine. Since stack areas
grow downwards and should always have a guard page, overruns shouldn't
be too much of a concern (for that matter, randomization still makes
a difference here also, it seems.)
This allows us to regain another ~256 MB or so of contiguous address
space (areas smaller than that could still be inserted in the 0x6.. to
0x7.. block, but if you had 10MB of free address space below 0x6..,
and 246MB above it, you couldn't allocate a 256MB block.)
Part of #19592.
We ideally want to avoid further fragmentation and just insert in the
smallest possible slot in that case.
Part of #19592. With DISABLE_ASLR=1, seems to save about 120 MB or so
of address space, which is a lot on 32-bit.
This doesn't matter so much because the hint's used for
an AVL tree lookup both for next and previous, but it
probably does at least a bit because the new area's size
is used in the tree lookups.
The kernel will ignore the reservations if there's not enough space
left in the address space anyway.
It seems using larger reservations prevents address space fragmentation,
and so this by itself may be enough to fix#19592.
128 MB should be more than enough memory in the global cache
for most applications (this limit's hit once the application
has 512 MB of live allocations, based on the current free
percentage of 25%.)
Otherwise we might get lock-order inversion in the VFS (see comment in
VMCache::RemoveArea) and deadlock the system, which indeed I observed
while testing some things today.
If the resize-needed amount changed while we were allocating memory,
then we'd leak the new buffer.
In testing, I added an ASSERT() to check if this case actually happened,
and it didn't seem to fire when using the system (with a debug kernel
though, admittedly.)
Inspired by a change suggested on GitHub, but implemented in a
completely different way (that cleans up the code at the same time.)
Remove shared message handling from ColorListView,
you are expected to implement this yourself and these
message constants were not actually being used by
the message target.
Do color drop handling in Appearance and Terminal.
Handle all color drops in WasDropped().
Allow current selection to remain, only update color.
TODO Changing selection on external drops should be
fixed in BListView. Work-around in BColorListView.
Fixes#19562
Change-Id: Ic99bbb1288fd736778eac831d38e453122815abc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9296
Reviewed-by: John Scipione <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Adjust tray icons and clock to fit accordingly. Leaf menu height is
reduced by 1 in vertical mode to match.
This makes the overlap of maximized windows and Deskbar less noticeable,
especially in horizontal mini-mode.
Fixes#16231
Change-Id: I622d008ee093e018ebcb46e3c45647577f46184f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8833
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
To allow consumers to cause the "don't fragment" bit to be set in
all IPv4 packet headers.
There is no standard way of doing this, and different OSes expose
this option in different ways. Linux has "IP_MTU_DISCOVER", but it
takes an enum, not a boolean. NetBSD and OpenBSD appear to have
no socket option, instead they have "IP_MTUDISC", an option for
the "ip_output()" kernel-level network stack method.
"IP_DONTFRAG" sockopt originates on FreeBSD, and it seems macOS now
also supports it in version 11+. Windows has "IP_DONTFRAGMENT",
which, at a glance, appears to do the same thing. So this looks
like the one that makes the most sense to adopt.
This doesn't add any code to process MTU changes yet, though.
Change-Id: I492d22dbd0ee5f4ab35c600396ad3d3ec9f4f200
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9401
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
Using the new net_error_data parameter to error_received.
Move the "update routing table" TODO into the IPv4 module,
since the ICMP module doesn't deal with the routing table
at all, while the IPv4 module already does.
Also add a missing endian swap in ICMP error_reply.
Change-Id: I1135eaa442f515d656143c76ab130be19cdcbaf2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9400
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Same structure as used for error_reply, to contain information
(like path MTU or redirect gateway) from the original error packet,
so that upper layers don't have to re-parse it.
Nothing uses or passes it around at present, but it will be used
in the next commits.
Change-Id: I38a3dec5506bdcb77a7850294082db7be74dd80f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9399
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
* POSIX also specifies in6 availability in in.h, not just RFCs.
* Drop IPPORT_USERRESERVED. It's in RFC 1700, but FreeBSD and musl
do not define it, and OpenBSD and NetBSD disagree on its value
(the RFC says 5000, while OpenBSD used this "49151" starting
in 1998.)
* Organize the remainder with clear indications of what RFC defined them
(if indeed they were specified in an RFC.)
* Drop "helpful macros"; they're guarded by _KERNEL on OpenBSD.
Change-Id: Ia20be56398130ee22d70b38ee25a3f609b567c3b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9398
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
IP_HDRINCL isn't POSIX. The FreeBSD manual page for it doesn't specify,
but the Linux manual page indicates it will compute the checksum.
traceroute seems to depend on it doing so.
Significantly improves the situation in #3210.
* Have bread() output a NULL *bpp when returning an error (consistent
with FreeBSD).
* Enable brelse() to handle a NULL argument (consistent with FreeBSD).
* Ensure that when getblkx() returns an error, no clean-up remains to
be done by bread() or getblk().
* Let allocate_data() set buf::b_owned, and set it only if successful
in allocating, so the flag won't be misleading to put_buf() after a
failure.
* Revise vput() to avoid situations when, after an error, it might
call put_vnode() before the node is published to the VFS.
Change-Id: I42cc1684fe5b68333284b149e72a794c93ac71ff
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9393
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
UdpDomainSupport::ConnectEndpoint() uses SetToEmpty() to unconnect when used
with AF_UNSPEC.
checked against the output of the test sortix/os-test/udp/connect-unconnect-getpeername
Change-Id: Iccfa46399a0e14057459966a2f406469566bcbac
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9396
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
should return EDESTADDRREQ for UDP
checked against the output of the test sortix/os-test/udp/sendto-null
Change-Id: I3bc61e0cc9d75319d61f0395f1ae45d28171bfef
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9395
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
checked against the output of the test sortix/os-test/udp/connect-send-error-send
* icmp: add more error codes
Change-Id: I7b1695d37cf5eae8cd09132047404b990f8791dd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9394
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
* Cursor bitmaps are now generated at runtime from vectors
embedded in CursorData.cpp (replacing the old bitmaps).
There is still a fallback bitmap pointer in case generation fails.
All cursors should scale correctly, and hotspots are accounted for.
* The Pointer vector in data/artwork/cursors was very slightly tweaked
to look better at larger sizes - the white edge at the bottom was made
rounder.
* The new dynamically-generated cursor looks close to the old one,
unless you're zoomed in and comparing them pixel-by-pixel.
* The cursor shadow is generated with a gaussian blur to create a
similar look to the old shadow, which was created in an image editor.
Fixes#13171.
Co-authored-by: Augustin Cavalier <[email protected]>
Change-Id: Ifa881619354a42bc60d2b5c1d0443e8addf6e0f5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5200
Reviewed-by: nephele nephele <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
instead of returning B_NOT_SUPPORTED.
* this fixes a few tests of sortix/os-test/udp.
Change-Id: I961e71cc419ce7ab38419749a42df8737e272c83
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9392
Reviewed-by: waddlesplash <[email protected]>
BView-related code removed or disabled, of course, but this now uses
the ColorConversions class, and adds some more ImportBits APIs from that.
Change-Id: I805cef159bac52173ef16030eae69e83db6f061b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9391
Reviewed-by: waddlesplash <[email protected]>
Toolbars go with menu bars, and so to blend in better with them,
should use the same colors. (Under the default color schemes,
the menu bar and panel colors are the same, so this makes no
visible difference there.)
Added a TODO for button colors as we may want to do something different
for that, it also makes no difference with the default scheme, but
for non-default schemes may matter.
Improves #19629.
This fixes a bug that's been annoying me - when I use Workspaces to
move a terminal that's scrolling/moving on another workspace, the
terminal begins drawing into the current workspace; this also happens with
some other apps, like Qemu. I tracked this down to Desktop::MoveWindowBy,
where we update an invisible window's current workspace to the one it's
being moved on. Trouble is, the current workspace is set to -1 for windows
on another workspace, and IsVisible just returns whether the current
workspace is >=0, so doing this causes IsVisible to return true when it
shouldn't.
This patch replaces that call with one that sets a separate
invisible workspace member variable, which preserves all window moving
functionality without improperly setting a window as visible. It also fixes a
minor graphical glitch when moving off-workspace tiled windows.
Fixes#6722
Change-Id: I2c4f04602caed85bf08391d0ea99e4dc74c1e1d8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9256
Reviewed-by: waddlesplash <[email protected]>