Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2:
ocfs2: Fix a race in o2dlm lockres mastery
Ocfs2: Handle deletion of reflinked oprhan inodes correctly.
Ocfs2: Journaling i_flags and i_orphaned_slot when adding inode to orphan dir.
ocfs2: Clear undo bits when local alloc is freed
ocfs2: Init meta_ac properly in ocfs2_create_empty_xattr_block.
ocfs2: Fix the update of name_offset when removing xattrs
ocfs2: Always try for maximum bits with new local alloc windows
ocfs2: set i_mode on disk during acl operations
ocfs2: Update i_blocks in reflink operations.
ocfs2: Change bg_chain check for ocfs2_validate_gd_parent.
[PATCH] Skip check for mandatory locks when unlocking

+223 -74
+72 -5
fs/ocfs2/acl.c
··· 30 30 #include "alloc.h" 31 31 #include "dlmglue.h" 32 32 #include "file.h" 33 + #include "inode.h" 34 + #include "journal.h" 33 35 #include "ocfs2_fs.h" 34 36 35 37 #include "xattr.h" ··· 168 166 } 169 167 170 168 /* 169 + * Helper function to set i_mode in memory and disk. Some call paths 170 + * will not have di_bh or a journal handle to pass, in which case it 171 + * will create it's own. 172 + */ 173 + static int ocfs2_acl_set_mode(struct inode *inode, struct buffer_head *di_bh, 174 + handle_t *handle, umode_t new_mode) 175 + { 176 + int ret, commit_handle = 0; 177 + struct ocfs2_dinode *di; 178 + 179 + if (di_bh == NULL) { 180 + ret = ocfs2_read_inode_block(inode, &di_bh); 181 + if (ret) { 182 + mlog_errno(ret); 183 + goto out; 184 + } 185 + } else 186 + get_bh(di_bh); 187 + 188 + if (handle == NULL) { 189 + handle = ocfs2_start_trans(OCFS2_SB(inode->i_sb), 190 + OCFS2_INODE_UPDATE_CREDITS); 191 + if (IS_ERR(handle)) { 192 + ret = PTR_ERR(handle); 193 + mlog_errno(ret); 194 + goto out_brelse; 195 + } 196 + 197 + commit_handle = 1; 198 + } 199 + 200 + di = (struct ocfs2_dinode *)di_bh->b_data; 201 + ret = ocfs2_journal_access_di(handle, INODE_CACHE(inode), di_bh, 202 + OCFS2_JOURNAL_ACCESS_WRITE); 203 + if (ret) { 204 + mlog_errno(ret); 205 + goto out_commit; 206 + } 207 + 208 + inode->i_mode = new_mode; 209 + di->i_mode = cpu_to_le16(inode->i_mode); 210 + 211 + ocfs2_journal_dirty(handle, di_bh); 212 + 213 + out_commit: 214 + if (commit_handle) 215 + ocfs2_commit_trans(OCFS2_SB(inode->i_sb), handle); 216 + out_brelse: 217 + brelse(di_bh); 218 + out: 219 + return ret; 220 + } 221 + 222 + /* 171 223 * Set the access or default ACL of an inode. 172 224 */ 173 225 static int ocfs2_set_acl(handle_t *handle, ··· 249 193 if (ret < 0) 250 194 return ret; 251 195 else { 252 - inode->i_mode = mode; 253 196 if (ret == 0) 254 197 acl = NULL; 198 + 199 + ret = ocfs2_acl_set_mode(inode, di_bh, 200 + handle, mode); 201 + if (ret) 202 + return ret; 203 + 255 204 } 256 205 } 257 206 break; ··· 344 283 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); 345 284 struct posix_acl *acl = NULL; 346 285 int ret = 0; 286 + mode_t mode; 347 287 348 288 if (!S_ISLNK(inode->i_mode)) { 349 289 if (osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL) { ··· 353 291 if (IS_ERR(acl)) 354 292 return PTR_ERR(acl); 355 293 } 356 - if (!acl) 357 - inode->i_mode &= ~current_umask(); 294 + if (!acl) { 295 + mode = inode->i_mode & ~current_umask(); 296 + ret = ocfs2_acl_set_mode(inode, di_bh, handle, mode); 297 + if (ret) { 298 + mlog_errno(ret); 299 + goto cleanup; 300 + } 301 + } 358 302 } 359 303 if ((osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL) && acl) { 360 304 struct posix_acl *clone; 361 - mode_t mode; 362 305 363 306 if (S_ISDIR(inode->i_mode)) { 364 307 ret = ocfs2_set_acl(handle, inode, di_bh, ··· 380 313 mode = inode->i_mode; 381 314 ret = posix_acl_create_masq(clone, &mode); 382 315 if (ret >= 0) { 383 - inode->i_mode = mode; 316 + ret = ocfs2_acl_set_mode(inode, di_bh, handle, mode); 384 317 if (ret > 0) { 385 318 ret = ocfs2_set_acl(handle, inode, 386 319 di_bh, ACL_TYPE_ACCESS,
+1 -3
fs/ocfs2/dlm/dlmmaster.c
··· 1875 1875 ok: 1876 1876 spin_unlock(&res->spinlock); 1877 1877 } 1878 - spin_unlock(&dlm->spinlock); 1879 1878 1880 1879 // mlog(0, "woo! got an assert_master from node %u!\n", 1881 1880 // assert->node_idx); ··· 1925 1926 /* master is known, detach if not already detached. 1926 1927 * ensures that only one assert_master call will happen 1927 1928 * on this mle. */ 1928 - spin_lock(&dlm->spinlock); 1929 1929 spin_lock(&dlm->master_lock); 1930 1930 1931 1931 rr = atomic_read(&mle->mle_refs.refcount); ··· 1957 1959 __dlm_put_mle(mle); 1958 1960 } 1959 1961 spin_unlock(&dlm->master_lock); 1960 - spin_unlock(&dlm->spinlock); 1961 1962 } else if (res) { 1962 1963 if (res->owner != assert->node_idx) { 1963 1964 mlog(0, "assert_master from %u, but current " ··· 1964 1967 res->owner, namelen, name); 1965 1968 } 1966 1969 } 1970 + spin_unlock(&dlm->spinlock); 1967 1971 1968 1972 done: 1969 1973 ret = 0;
+15
fs/ocfs2/inode.c
··· 891 891 /* Do some basic inode verification... */ 892 892 di = (struct ocfs2_dinode *) di_bh->b_data; 893 893 if (!(di->i_flags & cpu_to_le32(OCFS2_ORPHANED_FL))) { 894 + /* 895 + * Inodes in the orphan dir must have ORPHANED_FL. The only 896 + * inodes that come back out of the orphan dir are reflink 897 + * targets. A reflink target may be moved out of the orphan 898 + * dir between the time we scan the directory and the time we 899 + * process it. This would lead to HAS_REFCOUNT_FL being set but 900 + * ORPHANED_FL not. 901 + */ 902 + if (di->i_dyn_features & cpu_to_le16(OCFS2_HAS_REFCOUNT_FL)) { 903 + mlog(0, "Reflinked inode %llu is no longer orphaned. " 904 + "it shouldn't be deleted\n", 905 + (unsigned long long)oi->ip_blkno); 906 + goto bail; 907 + } 908 + 894 909 /* for lack of a better error? */ 895 910 status = -EEXIST; 896 911 mlog(ML_ERROR,
+6 -4
fs/ocfs2/localalloc.c
··· 872 872 (unsigned long long)la_start_blk, 873 873 (unsigned long long)blkno); 874 874 875 - status = ocfs2_free_clusters(handle, main_bm_inode, 876 - main_bm_bh, blkno, count); 875 + status = ocfs2_release_clusters(handle, 876 + main_bm_inode, 877 + main_bm_bh, blkno, 878 + count); 877 879 if (status < 0) { 878 880 mlog_errno(status); 879 881 goto bail; ··· 986 984 } 987 985 988 986 retry_enospc: 989 - (*ac)->ac_bits_wanted = osb->local_alloc_bits; 990 - 987 + (*ac)->ac_bits_wanted = osb->local_alloc_default_bits; 991 988 status = ocfs2_reserve_cluster_bitmap_bits(osb, *ac); 992 989 if (status == -ENOSPC) { 993 990 if (ocfs2_recalc_la_window(osb, OCFS2_LA_EVENT_ENOSPC) == ··· 1062 1061 OCFS2_LA_DISABLED) 1063 1062 goto bail; 1064 1063 1064 + ac->ac_bits_wanted = osb->local_alloc_default_bits; 1065 1065 status = ocfs2_claim_clusters(osb, handle, ac, 1066 1066 osb->local_alloc_bits, 1067 1067 &cluster_off,
+1 -1
fs/ocfs2/locks.c
··· 133 133 134 134 if (!(fl->fl_flags & FL_POSIX)) 135 135 return -ENOLCK; 136 - if (__mandatory_lock(inode)) 136 + if (__mandatory_lock(inode) && fl->fl_type != F_UNLCK) 137 137 return -ENOLCK; 138 138 139 139 return ocfs2_plock(osb->cconn, OCFS2_I(inode)->ip_blkno, file, cmd, fl);
+23 -5
fs/ocfs2/namei.c
··· 84 84 static int ocfs2_orphan_add(struct ocfs2_super *osb, 85 85 handle_t *handle, 86 86 struct inode *inode, 87 - struct ocfs2_dinode *fe, 87 + struct buffer_head *fe_bh, 88 88 char *name, 89 89 struct ocfs2_dir_lookup_result *lookup, 90 90 struct inode *orphan_dir_inode); ··· 879 879 fe = (struct ocfs2_dinode *) fe_bh->b_data; 880 880 881 881 if (inode_is_unlinkable(inode)) { 882 - status = ocfs2_orphan_add(osb, handle, inode, fe, orphan_name, 882 + status = ocfs2_orphan_add(osb, handle, inode, fe_bh, orphan_name, 883 883 &orphan_insert, orphan_dir); 884 884 if (status < 0) { 885 885 mlog_errno(status); ··· 1300 1300 if (S_ISDIR(new_inode->i_mode) || 1301 1301 (ocfs2_read_links_count(newfe) == 1)) { 1302 1302 status = ocfs2_orphan_add(osb, handle, new_inode, 1303 - newfe, orphan_name, 1303 + newfe_bh, orphan_name, 1304 1304 &orphan_insert, orphan_dir); 1305 1305 if (status < 0) { 1306 1306 mlog_errno(status); ··· 1911 1911 static int ocfs2_orphan_add(struct ocfs2_super *osb, 1912 1912 handle_t *handle, 1913 1913 struct inode *inode, 1914 - struct ocfs2_dinode *fe, 1914 + struct buffer_head *fe_bh, 1915 1915 char *name, 1916 1916 struct ocfs2_dir_lookup_result *lookup, 1917 1917 struct inode *orphan_dir_inode) ··· 1919 1919 struct buffer_head *orphan_dir_bh = NULL; 1920 1920 int status = 0; 1921 1921 struct ocfs2_dinode *orphan_fe; 1922 + struct ocfs2_dinode *fe = (struct ocfs2_dinode *) fe_bh->b_data; 1922 1923 1923 1924 mlog_entry("(inode->i_ino = %lu)\n", inode->i_ino); 1924 1925 ··· 1960 1959 goto leave; 1961 1960 } 1962 1961 1962 + /* 1963 + * We're going to journal the change of i_flags and i_orphaned_slot. 1964 + * It's safe anyway, though some callers may duplicate the journaling. 1965 + * Journaling within the func just make the logic look more 1966 + * straightforward. 1967 + */ 1968 + status = ocfs2_journal_access_di(handle, 1969 + INODE_CACHE(inode), 1970 + fe_bh, 1971 + OCFS2_JOURNAL_ACCESS_WRITE); 1972 + if (status < 0) { 1973 + mlog_errno(status); 1974 + goto leave; 1975 + } 1976 + 1963 1977 le32_add_cpu(&fe->i_flags, OCFS2_ORPHANED_FL); 1964 1978 1965 1979 /* Record which orphan dir our inode now resides 1966 1980 * in. delete_inode will use this to determine which orphan 1967 1981 * dir to lock. */ 1968 1982 fe->i_orphaned_slot = cpu_to_le16(osb->slot_num); 1983 + 1984 + ocfs2_journal_dirty(handle, fe_bh); 1969 1985 1970 1986 mlog(0, "Inode %llu orphaned in slot %d\n", 1971 1987 (unsigned long long)OCFS2_I(inode)->ip_blkno, osb->slot_num); ··· 2141 2123 } 2142 2124 2143 2125 di = (struct ocfs2_dinode *)new_di_bh->b_data; 2144 - status = ocfs2_orphan_add(osb, handle, inode, di, orphan_name, 2126 + status = ocfs2_orphan_add(osb, handle, inode, new_di_bh, orphan_name, 2145 2127 &orphan_insert, orphan_dir); 2146 2128 if (status < 0) { 2147 2129 mlog_errno(status);
+12 -2
fs/ocfs2/ocfs2.h
··· 763 763 return megs << (20 - OCFS2_SB(sb)->s_clustersize_bits); 764 764 } 765 765 766 - #define ocfs2_set_bit ext2_set_bit 767 - #define ocfs2_clear_bit ext2_clear_bit 766 + static inline void _ocfs2_set_bit(unsigned int bit, unsigned long *bitmap) 767 + { 768 + ext2_set_bit(bit, bitmap); 769 + } 770 + #define ocfs2_set_bit(bit, addr) _ocfs2_set_bit((bit), (unsigned long *)(addr)) 771 + 772 + static inline void _ocfs2_clear_bit(unsigned int bit, unsigned long *bitmap) 773 + { 774 + ext2_clear_bit(bit, bitmap); 775 + } 776 + #define ocfs2_clear_bit(bit, addr) _ocfs2_clear_bit((bit), (unsigned long *)(addr)) 777 + 768 778 #define ocfs2_test_bit ext2_test_bit 769 779 #define ocfs2_find_next_zero_bit ext2_find_next_zero_bit 770 780 #define ocfs2_find_next_bit ext2_find_next_bit
+1
fs/ocfs2/refcounttree.c
··· 4075 4075 OCFS2_I(t_inode)->ip_dyn_features = OCFS2_I(s_inode)->ip_dyn_features; 4076 4076 spin_unlock(&OCFS2_I(t_inode)->ip_lock); 4077 4077 i_size_write(t_inode, size); 4078 + t_inode->i_blocks = s_inode->i_blocks; 4078 4079 4079 4080 di->i_xattr_inline_size = s_di->i_xattr_inline_size; 4080 4081 di->i_clusters = s_di->i_clusters;
+82 -47
fs/ocfs2/suballoc.c
··· 95 95 struct buffer_head *group_bh, 96 96 unsigned int bit_off, 97 97 unsigned int num_bits); 98 - static inline int ocfs2_block_group_clear_bits(handle_t *handle, 99 - struct inode *alloc_inode, 100 - struct ocfs2_group_desc *bg, 101 - struct buffer_head *group_bh, 102 - unsigned int bit_off, 103 - unsigned int num_bits); 104 - 105 98 static int ocfs2_relink_block_group(handle_t *handle, 106 99 struct inode *alloc_inode, 107 100 struct buffer_head *fe_bh, ··· 145 152 146 153 #define do_error(fmt, ...) \ 147 154 do{ \ 148 - if (clean_error) \ 155 + if (resize) \ 149 156 mlog(ML_ERROR, fmt "\n", ##__VA_ARGS__); \ 150 157 else \ 151 158 ocfs2_error(sb, fmt, ##__VA_ARGS__); \ ··· 153 160 154 161 static int ocfs2_validate_gd_self(struct super_block *sb, 155 162 struct buffer_head *bh, 156 - int clean_error) 163 + int resize) 157 164 { 158 165 struct ocfs2_group_desc *gd = (struct ocfs2_group_desc *)bh->b_data; 159 166 ··· 204 211 static int ocfs2_validate_gd_parent(struct super_block *sb, 205 212 struct ocfs2_dinode *di, 206 213 struct buffer_head *bh, 207 - int clean_error) 214 + int resize) 208 215 { 209 216 unsigned int max_bits; 210 217 struct ocfs2_group_desc *gd = (struct ocfs2_group_desc *)bh->b_data; ··· 226 233 return -EINVAL; 227 234 } 228 235 229 - if (le16_to_cpu(gd->bg_chain) >= 230 - le16_to_cpu(di->id2.i_chain.cl_next_free_rec)) { 236 + /* In resize, we may meet the case bg_chain == cl_next_free_rec. */ 237 + if ((le16_to_cpu(gd->bg_chain) > 238 + le16_to_cpu(di->id2.i_chain.cl_next_free_rec)) || 239 + ((le16_to_cpu(gd->bg_chain) == 240 + le16_to_cpu(di->id2.i_chain.cl_next_free_rec)) && !resize)) { 231 241 do_error("Group descriptor #%llu has bad chain %u", 232 242 (unsigned long long)bh->b_blocknr, 233 243 le16_to_cpu(gd->bg_chain)); ··· 1971 1975 bits_wanted, cluster_start, num_clusters); 1972 1976 } 1973 1977 1974 - static inline int ocfs2_block_group_clear_bits(handle_t *handle, 1975 - struct inode *alloc_inode, 1976 - struct ocfs2_group_desc *bg, 1977 - struct buffer_head *group_bh, 1978 - unsigned int bit_off, 1979 - unsigned int num_bits) 1978 + static int ocfs2_block_group_clear_bits(handle_t *handle, 1979 + struct inode *alloc_inode, 1980 + struct ocfs2_group_desc *bg, 1981 + struct buffer_head *group_bh, 1982 + unsigned int bit_off, 1983 + unsigned int num_bits, 1984 + void (*undo_fn)(unsigned int bit, 1985 + unsigned long *bmap)) 1980 1986 { 1981 1987 int status; 1982 1988 unsigned int tmp; 1983 - int journal_type = OCFS2_JOURNAL_ACCESS_WRITE; 1984 1989 struct ocfs2_group_desc *undo_bg = NULL; 1985 - int cluster_bitmap = 0; 1986 1990 1987 1991 mlog_entry_void(); 1988 1992 ··· 1992 1996 1993 1997 mlog(0, "off = %u, num = %u\n", bit_off, num_bits); 1994 1998 1995 - if (ocfs2_is_cluster_bitmap(alloc_inode)) 1996 - journal_type = OCFS2_JOURNAL_ACCESS_UNDO; 1997 - 1999 + BUG_ON(undo_fn && !ocfs2_is_cluster_bitmap(alloc_inode)); 1998 2000 status = ocfs2_journal_access_gd(handle, INODE_CACHE(alloc_inode), 1999 - group_bh, journal_type); 2001 + group_bh, 2002 + undo_fn ? 2003 + OCFS2_JOURNAL_ACCESS_UNDO : 2004 + OCFS2_JOURNAL_ACCESS_WRITE); 2000 2005 if (status < 0) { 2001 2006 mlog_errno(status); 2002 2007 goto bail; 2003 2008 } 2004 2009 2005 - if (ocfs2_is_cluster_bitmap(alloc_inode)) 2006 - cluster_bitmap = 1; 2007 - 2008 - if (cluster_bitmap) { 2010 + if (undo_fn) { 2009 2011 jbd_lock_bh_state(group_bh); 2010 2012 undo_bg = (struct ocfs2_group_desc *) 2011 2013 bh2jh(group_bh)->b_committed_data; ··· 2014 2020 while(tmp--) { 2015 2021 ocfs2_clear_bit((bit_off + tmp), 2016 2022 (unsigned long *) bg->bg_bitmap); 2017 - if (cluster_bitmap) 2018 - ocfs2_set_bit(bit_off + tmp, 2019 - (unsigned long *) undo_bg->bg_bitmap); 2023 + if (undo_fn) 2024 + undo_fn(bit_off + tmp, 2025 + (unsigned long *) undo_bg->bg_bitmap); 2020 2026 } 2021 2027 le16_add_cpu(&bg->bg_free_bits_count, num_bits); 2022 2028 2023 - if (cluster_bitmap) 2029 + if (undo_fn) 2024 2030 jbd_unlock_bh_state(group_bh); 2025 2031 2026 2032 status = ocfs2_journal_dirty(handle, group_bh); ··· 2033 2039 /* 2034 2040 * expects the suballoc inode to already be locked. 2035 2041 */ 2036 - int ocfs2_free_suballoc_bits(handle_t *handle, 2037 - struct inode *alloc_inode, 2038 - struct buffer_head *alloc_bh, 2039 - unsigned int start_bit, 2040 - u64 bg_blkno, 2041 - unsigned int count) 2042 + static int _ocfs2_free_suballoc_bits(handle_t *handle, 2043 + struct inode *alloc_inode, 2044 + struct buffer_head *alloc_bh, 2045 + unsigned int start_bit, 2046 + u64 bg_blkno, 2047 + unsigned int count, 2048 + void (*undo_fn)(unsigned int bit, 2049 + unsigned long *bitmap)) 2042 2050 { 2043 2051 int status = 0; 2044 2052 u32 tmp_used; ··· 2075 2079 2076 2080 status = ocfs2_block_group_clear_bits(handle, alloc_inode, 2077 2081 group, group_bh, 2078 - start_bit, count); 2082 + start_bit, count, undo_fn); 2079 2083 if (status < 0) { 2080 2084 mlog_errno(status); 2081 2085 goto bail; ··· 2106 2110 return status; 2107 2111 } 2108 2112 2113 + int ocfs2_free_suballoc_bits(handle_t *handle, 2114 + struct inode *alloc_inode, 2115 + struct buffer_head *alloc_bh, 2116 + unsigned int start_bit, 2117 + u64 bg_blkno, 2118 + unsigned int count) 2119 + { 2120 + return _ocfs2_free_suballoc_bits(handle, alloc_inode, alloc_bh, 2121 + start_bit, bg_blkno, count, NULL); 2122 + } 2123 + 2109 2124 int ocfs2_free_dinode(handle_t *handle, 2110 2125 struct inode *inode_alloc_inode, 2111 2126 struct buffer_head *inode_alloc_bh, ··· 2130 2123 inode_alloc_bh, bit, bg_blkno, 1); 2131 2124 } 2132 2125 2133 - int ocfs2_free_clusters(handle_t *handle, 2134 - struct inode *bitmap_inode, 2135 - struct buffer_head *bitmap_bh, 2136 - u64 start_blk, 2137 - unsigned int num_clusters) 2126 + static int _ocfs2_free_clusters(handle_t *handle, 2127 + struct inode *bitmap_inode, 2128 + struct buffer_head *bitmap_bh, 2129 + u64 start_blk, 2130 + unsigned int num_clusters, 2131 + void (*undo_fn)(unsigned int bit, 2132 + unsigned long *bitmap)) 2138 2133 { 2139 2134 int status; 2140 2135 u16 bg_start_bit; ··· 2163 2154 mlog(0, "bg_blkno = %llu, bg_start_bit = %u\n", 2164 2155 (unsigned long long)bg_blkno, bg_start_bit); 2165 2156 2166 - status = ocfs2_free_suballoc_bits(handle, bitmap_inode, bitmap_bh, 2167 - bg_start_bit, bg_blkno, 2168 - num_clusters); 2157 + status = _ocfs2_free_suballoc_bits(handle, bitmap_inode, bitmap_bh, 2158 + bg_start_bit, bg_blkno, 2159 + num_clusters, undo_fn); 2169 2160 if (status < 0) { 2170 2161 mlog_errno(status); 2171 2162 goto out; ··· 2177 2168 out: 2178 2169 mlog_exit(status); 2179 2170 return status; 2171 + } 2172 + 2173 + int ocfs2_free_clusters(handle_t *handle, 2174 + struct inode *bitmap_inode, 2175 + struct buffer_head *bitmap_bh, 2176 + u64 start_blk, 2177 + unsigned int num_clusters) 2178 + { 2179 + return _ocfs2_free_clusters(handle, bitmap_inode, bitmap_bh, 2180 + start_blk, num_clusters, 2181 + _ocfs2_set_bit); 2182 + } 2183 + 2184 + /* 2185 + * Give never-used clusters back to the global bitmap. We don't need 2186 + * to protect these bits in the undo buffer. 2187 + */ 2188 + int ocfs2_release_clusters(handle_t *handle, 2189 + struct inode *bitmap_inode, 2190 + struct buffer_head *bitmap_bh, 2191 + u64 start_blk, 2192 + unsigned int num_clusters) 2193 + { 2194 + return _ocfs2_free_clusters(handle, bitmap_inode, bitmap_bh, 2195 + start_blk, num_clusters, 2196 + _ocfs2_clear_bit); 2180 2197 } 2181 2198 2182 2199 static inline void ocfs2_debug_bg(struct ocfs2_group_desc *bg)
+5
fs/ocfs2/suballoc.h
··· 127 127 struct buffer_head *bitmap_bh, 128 128 u64 start_blk, 129 129 unsigned int num_clusters); 130 + int ocfs2_release_clusters(handle_t *handle, 131 + struct inode *bitmap_inode, 132 + struct buffer_head *bitmap_bh, 133 + u64 start_blk, 134 + unsigned int num_clusters); 130 135 131 136 static inline u64 ocfs2_which_suballoc_group(u64 block, unsigned int bit) 132 137 {
+5 -7
fs/ocfs2/xattr.c
··· 1622 1622 /* Now tell xh->xh_entries about it */ 1623 1623 for (i = 0; i < count; i++) { 1624 1624 offset = le16_to_cpu(xh->xh_entries[i].xe_name_offset); 1625 - if (offset < namevalue_offset) 1625 + if (offset <= namevalue_offset) 1626 1626 le16_add_cpu(&xh->xh_entries[i].xe_name_offset, 1627 1627 namevalue_size); 1628 1628 } ··· 6528 6528 int indexed) 6529 6529 { 6530 6530 int ret; 6531 - struct ocfs2_alloc_context *meta_ac; 6532 6531 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); 6533 - struct ocfs2_xattr_set_ctxt ctxt = { 6534 - .meta_ac = meta_ac, 6535 - }; 6532 + struct ocfs2_xattr_set_ctxt ctxt; 6536 6533 6537 - ret = ocfs2_reserve_new_metadata_blocks(osb, 1, &meta_ac); 6534 + memset(&ctxt, 0, sizeof(ctxt)); 6535 + ret = ocfs2_reserve_new_metadata_blocks(osb, 1, &ctxt.meta_ac); 6538 6536 if (ret < 0) { 6539 6537 mlog_errno(ret); 6540 6538 return ret; ··· 6554 6556 6555 6557 ocfs2_commit_trans(osb, ctxt.handle); 6556 6558 out: 6557 - ocfs2_free_alloc_context(meta_ac); 6559 + ocfs2_free_alloc_context(ctxt.meta_ac); 6558 6560 return ret; 6559 6561 } 6560 6562