Artificial intelligent assistant

Which comes first, for a write/create: permissions check or quota check? Browsing through `fs/nfs/...` but this wasn't obvious to me, so: if I try to write while being "above quota", to a file that doesn't belong to me, will I get `EPERM` or `ENOSPC`? Another way to phrase this is: for an _inode write_ , which comes first, the check for permissions, or the check for quota?

You can only write to a file after you have opened it. When you open it the permission checks are done. In theory one might argue that for a request for a read-write file descriptor the quota state might be checked but as you need write access to truncate a file and quota should never prevent space from being freed I assume this is not the case.

Thus due to the order of `open()` and `write()` the permission check should always come first.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 6872acca81598587216fbd541d1393c2