diff options
author | Richard Weinberger <richard@nod.at> | 2019-04-05 00:34:38 +0200 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2019-05-07 21:58:31 +0200 |
commit | 9ca2d732644484488db31123ecd3bf122b551566 (patch) | |
tree | 11fa3f5849b76e2f47a199a0c2994a99d53002dc /fs/ubifs/ubifs.h | |
parent | ubifs: orphan: Handle xattrs like files (diff) | |
download | linux-9ca2d732644484488db31123ecd3bf122b551566.tar.xz linux-9ca2d732644484488db31123ecd3bf122b551566.zip |
ubifs: Limit number of xattrs per inode
Since we have to write one deletion inode per xattr
into the journal, limit the max number of xattrs.
In theory UBIFS supported up to 65535 xattrs per inode.
But this never worked correctly, expect no powercuts happened.
Now we support only as many xattrs as we can store in 50% of a
LEB.
Even for tiny flashes this allows dozens of xattrs per inode,
which is for an embedded filesystem still fine.
In case someone has existing inodes with much more xattrs, it is
still possible to delete them.
UBIFS will fall back to an non-atomic deletion mode.
Reported-by: Stefan Agner <stefan@agner.ch>
Fixes: 1e51764a3c2ac ("UBIFS: add new flash file system")
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'fs/ubifs/ubifs.h')
-rw-r--r-- | fs/ubifs/ubifs.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index d28102829f6c..cf4b10f24b6d 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h @@ -2017,6 +2017,7 @@ int ubifs_xattr_set(struct inode *host, const char *name, const void *value, size_t size, int flags, bool check_lock); ssize_t ubifs_xattr_get(struct inode *host, const char *name, void *buf, size_t size); +int ubifs_purge_xattrs(struct inode *host); #ifdef CONFIG_UBIFS_FS_XATTR void ubifs_evict_xattr_inode(struct ubifs_info *c, ino_t xattr_inum); |