Commit 31b24446 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'bcachefs-2024-08-10' of git://evilpiepirate.org/bcachefs

Pull more bcachefs fixes from Kent Overstreet:
 "A couple last minute fixes for the new disk accounting

   - fix a bug that was causing ACLs to seemingly "disappear"

   - new on disk format version, bcachefs_metadata_version_disk_accounting_v3

     bcachefs_metadata_version_disk_accounting_v2 accidentally included
     padding in disk_accounting_key; fortunately, 6.11 isn't out yet so
     we can fix this with another version bump"

* tag 'bcachefs-2024-08-10' of git://evilpiepirate.org/bcachefs:
  bcachefs: bcachefs_metadata_version_disk_accounting_v3
  bcachefs: improve bch2_dev_usage_to_text()
  bcachefs: bch2_accounting_invalid()
  bcachefs: Switch to .get_inode_acl()
parents 34ac1e82 8a2491db
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -272,16 +272,19 @@ bch2_acl_to_xattr(struct btree_trans *trans,
	return xattr;
}

struct posix_acl *bch2_get_acl(struct mnt_idmap *idmap,
			       struct dentry *dentry, int type)
struct posix_acl *bch2_get_acl(struct inode *vinode, int type, bool rcu)
{
	struct bch_inode_info *inode = to_bch_ei(dentry->d_inode);
	struct bch_inode_info *inode = to_bch_ei(vinode);
	struct bch_fs *c = inode->v.i_sb->s_fs_info;
	struct bch_hash_info hash = bch2_hash_info_init(c, &inode->ei_inode);
	struct xattr_search_key search = X_SEARCH(acl_to_xattr_type(type), "", 0);
	struct btree_trans *trans = bch2_trans_get(c);
	struct btree_iter iter = { NULL };
	struct posix_acl *acl = NULL;

	if (rcu)
		return ERR_PTR(-ECHILD);

	struct btree_trans *trans = bch2_trans_get(c);
retry:
	bch2_trans_begin(trans);

+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ void bch2_acl_to_text(struct printbuf *, const void *, size_t);

#ifdef CONFIG_BCACHEFS_POSIX_ACL

struct posix_acl *bch2_get_acl(struct mnt_idmap *, struct dentry *, int);
struct posix_acl *bch2_get_acl(struct inode *, int, bool);

int bch2_set_acl_trans(struct btree_trans *, subvol_inum,
		       struct bch_inode_unpacked *,
+1 −1
Original line number Diff line number Diff line
@@ -1740,7 +1740,7 @@ void bch2_dev_alloc_debug_to_text(struct printbuf *out, struct bch_dev *ca)
	printbuf_tabstop_push(out, 16);
	printbuf_tabstop_push(out, 16);

	bch2_dev_usage_to_text(out, &stats);
	bch2_dev_usage_to_text(out, ca, &stats);

	prt_newline(out);

+2 −1
Original line number Diff line number Diff line
@@ -675,7 +675,8 @@ struct bch_sb_field_ext {
	x(btree_subvolume_children,	BCH_VERSION(1,  6))		\
	x(mi_btree_bitmap,		BCH_VERSION(1,  7))		\
	x(bucket_stripe_sectors,	BCH_VERSION(1,  8))		\
	x(disk_accounting_v2,		BCH_VERSION(1,  9))
	x(disk_accounting_v2,		BCH_VERSION(1,  9))		\
	x(disk_accounting_v3,		BCH_VERSION(1, 10))

enum bcachefs_metadata_version {
	bcachefs_metadata_version_min = 9,
+8 −4
Original line number Diff line number Diff line
@@ -71,7 +71,9 @@ bch2_fs_usage_read_short(struct bch_fs *c)
	return ret;
}

void bch2_dev_usage_to_text(struct printbuf *out, struct bch_dev_usage *usage)
void bch2_dev_usage_to_text(struct printbuf *out,
			    struct bch_dev *ca,
			    struct bch_dev_usage *usage)
{
	prt_printf(out, "\tbuckets\rsectors\rfragmented\r\n");

@@ -82,6 +84,8 @@ void bch2_dev_usage_to_text(struct printbuf *out, struct bch_dev_usage *usage)
			   usage->d[i].sectors,
			   usage->d[i].fragmented);
	}

	prt_printf(out, "capacity\t%llu\r\n", ca->mi.nbuckets);
}

static int bch2_check_fix_ptr(struct btree_trans *trans,
Loading