/* * CALIPSO - Common Architecture Label IPv6 Security Option * * This is an implementation of the CALIPSO protocol as specified in * RFC 5570. * * Authors: Paul Moore * Huw Davies * */ /* * (c) Copyright Hewlett-Packard Development Company, L.P., 2006 * (c) Copyright Huw Davies , 2015 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . * */ #ifndef _CALIPSO_H #define _CALIPSO_H #include #include #include #include #include #include #include #include #include /* known doi values */ #define CALIPSO_DOI_UNKNOWN 0x00000000 /* doi mapping types */ #define CALIPSO_MAP_UNKNOWN 0 #define CALIPSO_MAP_PASS 2 /* * CALIPSO DOI definitions */ /* DOI definition struct */ struct calipso_doi { u32 doi; u32 type; atomic_t refcount; struct list_head list; struct rcu_head rcu; }; /* * Sysctl Variables */ extern int calipso_cache_enabled; extern int calipso_cache_bucketsize; #ifdef CONFIG_NETLABEL int __init calipso_init(void); void calipso_exit(void); bool calipso_validate(const struct sk_buff *skb, const unsigned char *option); #else static inline int __init calipso_init(void) { return 0; } static inline void calipso_exit(void) { } static inline bool calipso_validate(const struct sk_buff *skb, const unsigned char *option) { return true; } #endif /* CONFIG_NETLABEL */ #endif /* _CALIPSO_H */ put type='hidden' name='id' value='0b34c261e235a5c74dcf78bd305845bd15fe2b42'/>
diff options
context:
space:
mode:
authorGoldwyn Rodrigues <rgoldwyn@suse.com>2016-09-30 10:40:52 -0500
committerDavid Sterba <dsterba@suse.com>2016-10-24 18:20:21 +0200
commit0b34c261e235a5c74dcf78bd305845bd15fe2b42 (patch)
tree07905fb6c4265397f59fd380a1abe6120d685d24 /Documentation
parent4547f4d8ffd63ba4ac129f9136027bd14b729101 (diff)
btrfs: qgroup: Prevent qgroup->reserved from going subzero
While free'ing qgroup->reserved resources, we much check if the page has not been invalidated by a truncate operation by checking if the page is still dirty before reducing the qgroup resources. Resources in such a case are free'd when the entire extent is released by delayed_ref. This fixes a double accounting while releasing resources in case of truncating a file, reproduced by the following testcase. SCRATCH_DEV=/dev/vdb SCRATCH_MNT=/mnt mkfs.btrfs -f $SCRATCH_DEV mount -t btrfs $SCRATCH_DEV $SCRATCH_MNT cd $SCRATCH_MNT btrfs quota enable $SCRATCH_MNT btrfs subvolume create a btrfs qgroup limit 500m a $SCRATCH_MNT sync for c in {1..15}; do dd if=/dev/zero bs=1M count=40 of=$SCRATCH_MNT/a/file; done sleep 10 sync sleep 5 touch $SCRATCH_MNT/a/newfile echo "Removing file" rm $SCRATCH_MNT/a/file Fixes: b9d0b38928 ("btrfs: Add handler for invalidate page") Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com> Reviewed-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'Documentation')