Skip to contentSkip to conversation

Quota support for ocfs2-tools (version 2)

PATCH New Jan Kara 3 participants 13 messages Jul 30, 2009 – Aug 3, 2009 OCFS2

lore
Share & tools
lore

Jan Kara

author
#0 lore raw

cover Quota support for ocfs2-tools (version 2)

Hi,

this is the next version of quota support for quota tools. I've addressed all
the comments of Tao, Joel and others. Sparse feature disabling also correctly updates quota information now and the patch is merged into the tunefs support patch.

Honza

author
#1 lore raw

PATCH 1/9 Update ocfs2_fs.h to contain all necessary quota structures and constants, create quota_tree.h

---
 include/ocfs2-kernel/ocfs2_fs.h   |   10 +++++++++-
 include/ocfs2-kernel/quota_tree.h |   15 +++++++++++++++
 2 files changed, 24 insertions(+), 1 deletions(-)
 create mode 100644 include/ocfs2-kernel/quota_tree.h
include/ocfs2-kernel/ocfs2_fs.h +9 -1
index 2140bb3..f3c9b53 100644
@@ -344,13 +344,17 @@ enum {
 #define OCFS2_FIRST_ONLINE_SYSTEM_INODE SLOT_MAP_SYSTEM_INODE
 	HEARTBEAT_SYSTEM_INODE,
 	GLOBAL_BITMAP_SYSTEM_INODE,
-#define OCFS2_LAST_GLOBAL_SYSTEM_INODE GLOBAL_BITMAP_SYSTEM_INODE
+	USER_QUOTA_SYSTEM_INODE,
+	GROUP_QUOTA_SYSTEM_INODE,
+#define OCFS2_LAST_GLOBAL_SYSTEM_INODE GROUP_QUOTA_SYSTEM_INODE
 	ORPHAN_DIR_SYSTEM_INODE,
 	EXTENT_ALLOC_SYSTEM_INODE,
 	INODE_ALLOC_SYSTEM_INODE,
 	JOURNAL_SYSTEM_INODE,
 	LOCAL_ALLOC_SYSTEM_INODE,
 	TRUNCATE_LOG_SYSTEM_INODE,
+	LOCAL_USER_QUOTA_SYSTEM_INODE,
+	LOCAL_GROUP_QUOTA_SYSTEM_INODE,
 	NUM_SYSTEM_INODES
 };
 
@@ -364,6 +368,8 @@ static struct ocfs2_system_inode_info ocfs2_system_inodes[NUM_SYSTEM_INODES] = {
 	[SLOT_MAP_SYSTEM_INODE]			= { "slot_map", 0, S_IFREG | 0644 },
 	[HEARTBEAT_SYSTEM_INODE]		= { "heartbeat", OCFS2_HEARTBEAT_FL, S_IFREG | 0644 },
 	[GLOBAL_BITMAP_SYSTEM_INODE]		= { "global_bitmap", 0, S_IFREG | 0644 },
+	[USER_QUOTA_SYSTEM_INODE]		= { "aquota.user", OCFS2_QUOTA_FL, S_IFREG | 0644 },
+	[GROUP_QUOTA_SYSTEM_INODE]		= { "aquota.group", OCFS2_QUOTA_FL, S_IFREG | 0644 },
 
 	/* Slot-specific system inodes (one copy per slot) */
 	[ORPHAN_DIR_SYSTEM_INODE]		= { "orphan_dir:%04d", 0, S_IFDIR | 0755 },
@@ -372,6 +378,8 @@ static struct ocfs2_system_inode_info ocfs2_system_inodes[NUM_SYSTEM_INODES] = {
 	[JOURNAL_SYSTEM_INODE]			= { "journal:%04d", OCFS2_JOURNAL_FL, S_IFREG | 0644 },
 	[LOCAL_ALLOC_SYSTEM_INODE]		= { "local_alloc:%04d", OCFS2_BITMAP_FL | OCFS2_LOCAL_ALLOC_FL, S_IFREG | 0644 },
 	[TRUNCATE_LOG_SYSTEM_INODE]		= { "truncate_log:%04d", OCFS2_DEALLOC_FL, S_IFREG | 0644 },
+	[LOCAL_USER_QUOTA_SYSTEM_INODE]		= { "aquota.user:%04d", OCFS2_QUOTA_FL, S_IFREG | 0644 },
+	[LOCAL_GROUP_QUOTA_SYSTEM_INODE]	= { "aquota.group:%04d", OCFS2_QUOTA_FL, S_IFREG | 0644 },
 };
 
 /* Parameter passed from mount.ocfs2 to module */
include/ocfs2-kernel/quota_tree.h new file +15 -0
new file mode 100644
index 0000000..9dbe835
@@ -0,0 +1,15 @@
+#ifndef _QUOTA_TREE_H
+#define _QUOTA_TREE_H
+
+#define QT_TREEOFF 1
+
+/* Header of leaf tree block */
+struct qt_disk_dqdbheader {
+	__le32 dqdh_next_free;	/* Number of next block with free entry */
+	__le32 dqdh_prev_free;	/* Number of previous block with free entry */
+	__le16 dqdh_entries;	/* Number of valid entries in block */
+	__le16 dqdh_pad1;
+	__le32 dqdh_pad2;
+};
+
+#endif
Signature · 1 line
1.6.0.2
author
#2 lore raw

PATCH 2/9 Provide ocfs2_cached_inode_extend_allocation()

In reply to Jan Kara

So far we had only ocfs2_extend_allocation() which read the inode from disk. Provide also the cached variant.

---
 include/ocfs2/ocfs2.h  |    3 ++
 libocfs2/extend_file.c |   52 +++++++++++++++++++++++++----------------------
 2 files changed, 31 insertions(+), 24 deletions(-)
include/ocfs2/ocfs2.h +3 -0
index 4dbbf43..47fede3 100644
@@ -505,6 +505,9 @@ errcode_t ocfs2_delete_extent_block(ocfs2_filesys *fs, uint64_t blkno);
  */
 errcode_t ocfs2_extend_allocation(ocfs2_filesys *fs, uint64_t ino,
 				  uint32_t new_clusters);
+/* Ditto for cached inode */
+errcode_t ocfs2_cached_inode_extend_allocation(ocfs2_cached_inode *ci,
+					       uint32_t new_clusters);
 /* Extend the file to the new size. No clusters will be allocated. */
 errcode_t ocfs2_extend_file(ocfs2_filesys *fs, uint64_t ino, uint64_t new_size);
 
libocfs2/extend_file.c +28 -24

80 lines not on this page · raw message

Signature · 1 line
1.6.0.2
author
#3 lore raw

PATCH 3/9 Implement quota functions to libocfs2

In reply to Jan Kara
---
 include/ocfs2/ocfs2.h     |   87 ++++
 libocfs2/Makefile         |    1 +
 libocfs2/feature_string.c |   18 +
 libocfs2/ocfs2_err.et     |    6 +
 libocfs2/quota.c          | 1216 +++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 1328 insertions(+), 0 deletions(-)
 create mode 100644 libocfs2/quota.c
include/ocfs2/ocfs2.h +87 -0
index 47fede3..9f861d6 100644
@@ -50,6 +50,7 @@
 #include <ocfs2-kernel/kernel-list.h>
 #include <ocfs2-kernel/sparse_endian_types.h>
 #include <ocfs2-kernel/ocfs2_fs.h>
+#include <ocfs2-kernel/quota_tree.h>
 #include <o2dlm/o2dlm.h>
 #include <o2cb/o2cb.h>
 #include <ocfs2/ocfs2_err.h>
@@ -125,16 +126,36 @@
 #define OCFS2_CHB_WAITING	2
 #define OCFS2_CHB_COMPLETE	3
 
+/* Flags for global quotafile info */
+#define OCFS2_QF_INFO_DIRTY 1
+
 typedef void (*ocfs2_chb_notify)(int state, char *progress, void *data);
 
 typedef struct _ocfs2_filesys ocfs2_filesys;
 typedef struct _ocfs2_cached_inode ocfs2_cached_inode;
+typedef struct _ocfs2_cached_dquot ocfs2_cached_dquot;
 typedef struct _io_channel io_channel;
 typedef struct _ocfs2_inode_scan ocfs2_inode_scan;
 typedef struct _ocfs2_dir_scan ocfs2_dir_scan;
 typedef struct _ocfs2_bitmap ocfs2_bitmap;
 typedef struct _ocfs2_devices ocfs2_devices;
 
+#define MAXQUOTAS 2
+#define USRQUOTA 0
+#define GRPQUOTA 1
+
+#define OCFS2_DEF_BLOCK_GRACE 604800 /* 1 week */
+#define OCFS2_DEF_INODE_GRACE 604800 /* 1 week */
+#define OCFS2_DEF_QUOTA_SYNC 10000   /* 10 seconds */
+
+struct _ocfs2_quota_info {
+	ocfs2_cached_inode *qi_inode;
+	int flags;
+	struct ocfs2_global_disk_dqinfo qi_info;
+};
+
+typedef struct _ocfs2_quota_info ocfs2_quota_info;
+
 struct _ocfs2_filesys {
 	char *fs_devname;
 	uint32_t fs_flags;
@@ -161,6 +182,8 @@ struct _ocfs2_filesys {
 	struct o2dlm_ctxt *fs_dlm_ctxt;
 	struct ocfs2_image_state *ost;
 
+	ocfs2_quota_info qinfo[MAXQUOTAS];
+
 	/* Reserved for the use of the calling application. */
 	void *fs_private;
 };
@@ -172,6 +195,15 @@ struct _ocfs2_cached_inode {
 	ocfs2_bitmap *ci_chains;
 };
 
+typedef unsigned int qid_t;
+
+struct _ocfs2_cached_dquot {
+	loff_t d_off;	/* Offset of structure in the file */
+	struct _ocfs2_cached_dquot *d_next;	/* Next entry in hashchain */
+	struct _ocfs2_cached_dquot **d_pprev;	/* Previous pointer in hashchain */
+	struct ocfs2_global_disk_dqblk d_ddquot;	/* Quota entry */
+};
+
 struct ocfs2_slot_data {
 	int		sd_valid;
 	unsigned int	sd_node_num;
@@ -205,6 +237,14 @@ struct _ocfs2_fs_options {
 	uint32_t opt_ro_compat;
 };
 
+struct _ocfs2_quota_hash {
+	int alloc_entries;
+	int used_entries;
+	ocfs2_cached_dquot **hash;
+};
+
+typedef struct _ocfs2_quota_hash ocfs2_quota_hash;
+
 errcode_t ocfs2_malloc(unsigned long size, void *ptr);
 errcode_t ocfs2_malloc0(unsigned long size, void *ptr);
 errcode_t ocfs2_free(void *ptr);
@@ -581,6 +621,53 @@ errcode_t ocfs2_meta_lock(ocfs2_filesys *fs, ocfs2_cached_inode *inode,
 
 errcode_t ocfs2_meta_unlock(ocfs2_filesys *fs, ocfs2_cached_inode *ci);
 
+/* Quota operations */
+static inline int ocfs2_global_dqstr_in_blk(int blocksize)
+{
+	return (blocksize - OCFS2_QBLK_RESERVED_SPACE -
+		sizeof(struct qt_disk_dqdbheader)) /
+		sizeof(struct ocfs2_global_disk_dqblk);
+}
+void ocfs2_swap_quota_header(struct ocfs2_disk_dqheader *header);
+void ocfs2_swap_quota_local_info(struct ocfs2_local_disk_dqinfo *info);
+void ocfs2_swap_quota_chunk_header(struct ocfs2_local_disk_chunk *chunk);
+void ocfs2_swap_quota_global_info(struct ocfs2_global_disk_dqinfo *info);
+void ocfs2_swap_quota_global_dqblk(struct ocfs2_global_disk_dqblk *dqblk);
+void ocfs2_swap_quota_leaf_block_header(struct qt_disk_dqdbheader *bheader);
+errcode_t ocfs2_init_local_quota_file(ocfs2_filesys *fs, int type,
+				      uint64_t blkno);
+errcode_t ocfs2_init_local_quota_files(ocfs2_filesys *fs, int type);
+int ocfs2_qtree_depth(int blocksize);
+int ocfs2_qtree_entry_unused(struct ocfs2_global_disk_dqblk *ddquot);
+errcode_t ocfs2_init_global_quota_file(ocfs2_filesys *fs, int type);
+errcode_t ocfs2_init_fs_quota_info(ocfs2_filesys *fs, int type);
+errcode_t ocfs2_read_global_quota_info(ocfs2_filesys *fs, int type);
+errcode_t ocfs2_write_global_quota_info(ocfs2_filesys *fs, int type);
+errcode_t ocfs2_write_dquot(ocfs2_filesys *fs, int type,
+			    ocfs2_cached_dquot *dquot);
+errcode_t ocfs2_delete_dquot(ocfs2_filesys *fs, int type,
+			     ocfs2_cached_dquot *dquot);
+errcode_t ocfs2_read_dquot(ocfs2_filesys *fs, int type, qid_t id,
+			   ocfs2_cached_dquot **ret_dquot);
+errcode_t ocfs2_new_quota_hash(ocfs2_quota_hash **hashp);
+errcode_t ocfs2_free_quota_hash(ocfs2_quota_hash *hash);
+errcode_t ocfs2_insert_quota_hash(ocfs2_quota_hash *hash,
+				  ocfs2_cached_dquot *dquot);
+errcode_t ocfs2_remove_quota_hash(ocfs2_quota_hash *hash,
+				  ocfs2_cached_dquot *dquot);
+errcode_t ocfs2_find_quota_hash(ocfs2_quota_hash *hash, qid_t id,
+				ocfs2_cached_dquot **dquotp);
+errcode_t ocfs2_find_create_quota_hash(ocfs2_quota_hash *hash, qid_t id,
+				       ocfs2_cached_dquot **dquotp);
+errcode_t ocfs2_compute_quota_usage(ocfs2_filesys *fs,
+				    ocfs2_quota_hash *usr_hash,
+				    ocfs2_quota_hash *grp_hash);
+errcode_t ocfs2_iterate_quota_hash(ocfs2_quota_hash *hash,
+				   errcode_t (*f)(ocfs2_cached_dquot *, void *),
+				   void *data);
+errcode_t ocfs2_write_release_dquots(ocfs2_filesys *fs, int type,
+				     ocfs2_quota_hash *hash);
+
 /* Low level */
 void ocfs2_swap_slot_map(struct ocfs2_slot_map *sm, int num_slots);
 void ocfs2_swap_slot_map_extended(struct ocfs2_slot_map_extended *se,
libocfs2/Makefile +1 -0
index 48cfe80..eeb854a 100644
@@ -73,6 +73,7 @@ CFILES = 		\
 	lockid.c	\
 	backup_super.c	\
 	feature_string.c\
+	quota.c		\
 	image.c		\
 	xattr.c
 
libocfs2/feature_string.c +18 -0
index 17e2675..18ae6e9 100644
@@ -123,6 +123,16 @@ static struct fs_feature_flags ocfs2_supported_features[] = {
 		{0, OCFS2_FEATURE_INCOMPAT_XATTR, 0},
 	},
 	{
+		"usrquota",
+		{0, 0, OCFS2_FEATURE_RO_COMPAT_USRQUOTA},
+		{0, 0, OCFS2_FEATURE_RO_COMPAT_USRQUOTA},
+	},
+	{
+		"grpquota",
+		{0, 0, OCFS2_FEATURE_RO_COMPAT_GRPQUOTA},
+		{0, 0, OCFS2_FEATURE_RO_COMPAT_GRPQUOTA},
+	},
+	{
 		NULL,
 		{0, 0, 0},
 		{0, 0, 0}
@@ -190,6 +200,14 @@ static struct feature_name ocfs2_feature_names[] = {
 		.fn_flag = {0, OCFS2_FEATURE_INCOMPAT_XATTR, 0},
 	},
 	{
+		.fn_name = "usrquota",
+		.fn_flag = {0, 0, OCFS2_FEATURE_RO_COMPAT_USRQUOTA},
+	},
+	{
+		.fn_name = "grpquota",
+		.fn_flag = {0, 0, OCFS2_FEATURE_RO_COMPAT_GRPQUOTA},
+	},
+	{
 		.fn_name = NULL,
 	},
 };
libocfs2/ocfs2_err.et +6 -0
index ddfa07c..13b03c4 100644
@@ -183,7 +183,13 @@ ec	OCFS2_ET_BAD_XATTR_BLOCK_MAGIC,
 ec	OCFS2_ET_UNKNOWN_FEATURE,
 	"Unknown feature"
 
+ec	OCFS2_ET_CORRUPT_QUOTA_FILE,
+	"Quota file is corrupted"
+
 ec	OCFS2_ET_CANNOT_DETERMINE_SECTOR_SIZE,
 	"Cannot determine sector size"
 
+ec	OCFS2_ET_NONEMTY_QUOTA_HASH,
+	"Freeing non-empty quota hash"
+
 	end
libocfs2/quota.c new file +1216 -0

1,216 lines not on this page · raw message

Signature · 1 line
1.6.0.2
#4 lore raw

PATCH 3/9 Implement quota functions to libocfs2

Hi Jan,

Quoted 44 lines · Jan Kara
---
 include/ocfs2/ocfs2.h     |   87 ++++
 libocfs2/Makefile         |    1 +
 libocfs2/feature_string.c |   18 +
 libocfs2/ocfs2_err.et     |    6 +
 libocfs2/quota.c          | 1216 +++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 1328 insertions(+), 0 deletions(-)
 create mode 100644 libocfs2/quota.c
include/ocfs2/ocfs2.h +30 -0
index 47fede3..9f861d6 100644
+#define OCFS2_LOCAL_QF_INIT_BLOCKS 2
+
+errcode_t ocfs2_init_local_quota_file(ocfs2_filesys *fs, int type,
+				      uint64_t blkno)
+{
+	ocfs2_cached_inode *ci = NULL;
+	struct ocfs2_dinode *di;
+	struct ocfs2_disk_dqheader *header;
+	struct ocfs2_local_disk_dqinfo *info;
+	unsigned int magics[] = OCFS2_LOCAL_QMAGICS;
+	int versions[] = OCFS2_LOCAL_QVERSIONS;
+	char *buf = NULL;
+	unsigned int written;
+	int bytes = ocfs2_blocks_to_bytes(fs, OCFS2_LOCAL_QF_INIT_BLOCKS);
+	errcode_t err;
+
+	err = ocfs2_read_cached_inode(fs, blkno, &ci);
+	if (err)
+		goto out;
+
+	if (!(ci->ci_inode->i_flags & OCFS2_VALID_FL) ||
+	    !(ci->ci_inode->i_flags & OCFS2_SYSTEM_FL) ||
+	    !(ci->ci_inode->i_flags & OCFS2_QUOTA_FL)) {
+		err = OCFS2_ET_INTERNAL_FAILURE;
+		goto out;
+	}
+	di = ci->ci_inode;
+
+	/* We need at least two blocks */
+	err = ocfs2_cached_inode_extend_allocation(ci,

include/ocfs2/ocfs2.h

Quoted 10 lines
include/ocfs2/ocfs2.h +10 -0
+		ocfs2_clusters_in_blocks(fs, OCFS2_LOCAL_QF_INIT_BLOCKS));
+	if (err)
+		goto out;
+	di->i_size = bytes;
+	di->i_mtime = time(NULL);
+	err = ocfs2_write_inode(fs, blkno, (char *)di);
+	if (err)
+		goto out;
+
+	err = ocfs2_malloc_blocks(fs->fs_io, bytes, &buf);

hey, ocfs2_malloc_blocks need num_blocks, not "bytes". so maybe OCFS2_LOCAL_QF_INIT_BLOCKS?

Oh, I just checked your v1, it was there. I am so sorry for not finding it earlier. And please change all of them in this patch.

Quoted 21 lines
include/ocfs2/ocfs2.h +21 -0
+/* Get free block in file (either from free list or create new one) */
+static errcode_t ocfs2_get_free_dqblk(ocfs2_filesys *fs, int type,
+				      unsigned int *blk)
+{
+	errcode_t err;
+	char *buf;
+	struct qt_disk_dqdbheader *dh;
+	struct ocfs2_global_disk_dqinfo *info = &(fs->qinfo[type].qi_info);
+	ocfs2_cached_inode *ci = fs->qinfo[type].qi_inode;
+
+	err = ocfs2_malloc_block(fs->fs_io, &buf);
+	if (err)
+		return err;
+	dh = (struct qt_disk_dqdbheader *)buf;
+	if (info->dqi_free_blk) {
+		*blk = info->dqi_free_blk;
+		err = read_blk(fs, type, *blk, buf);
+		if (err)
+			goto bail;
+		info->dqi_free_blk = le32_to_cpu(dh->dqdh_next_free);
+	}

include/ocfs2/ocfs2.h

Quoted 10 lines
include/ocfs2/ocfs2.h +10 -0
+	else {
+		if (info->dqi_blocks ==
+		    ocfs2_clusters_to_blocks(fs, ci->ci_inode->i_clusters)) {
+			err = ocfs2_cached_inode_extend_allocation(ci, 1);
+			if (err)
+				goto bail;
+		}
+		*blk = info->dqi_blocks++;
+		ci->ci_inode->i_size =
+				ocfs2_blocks_to_bytes(fs, info->dqi_blocks);

I am interested in this part. I read the kernel part yesterday. There you often check whether we need to add a chunk header in which case we need to extend the file by 2 blocks actually. But here we just extend 1 cluster? Is this a little different from the kernel part or we just simplify the case in the userspace? Please help me clarify it. Thanks.

include/ocfs2/ocfs2.h

Quoted 6 lines
include/ocfs2/ocfs2.h +6 -0
+	}
+	mark_quotafile_info_dirty(fs, type);
+bail:
+	ocfs2_free(&buf);
+	return err;
+}

Regards,
Tao

author
#5 lore raw

PATCH 3/9 Implement quota functions to libocfs2

Quoted 6 lines · Tao Ma
Quoted 6 lines
libocfs2/quota.c new file +6 -0
+	/* We need at least two blocks */
+	err = ocfs2_cached_inode_extend_allocation(ci,
+		ocfs2_clusters_in_blocks(fs, OCFS2_LOCAL_QF_INIT_BLOCKS));
+	if (err)
+		goto out;
+	di->i_size = bytes;
Quoted 8 lines

libocfs2/quota.c line 409

Quoted 6 lines
libocfs2/quota.c new file +6 -0
+	di->i_mtime = time(NULL);
+	err = ocfs2_write_inode(fs, blkno, (char *)di);
+	if (err)
+		goto out;
+
+	err = ocfs2_malloc_blocks(fs->fs_io, bytes, &buf);

hey, ocfs2_malloc_blocks need num_blocks, not "bytes". so maybe OCFS2_LOCAL_QF_INIT_BLOCKS?

Argh, right. I don't know why I thought it takes bytes. Will fix it
and resend the series. Thanks for catching this.

Quoted 30 lines

Oh, I just checked your v1, it was there. I am so sorry for not finding it earlier. And please change all of them in this patch.

Quoted 28 lines
libocfs2/quota.c new file +28 -0
+/* Get free block in file (either from free list or create new one) */
+static errcode_t ocfs2_get_free_dqblk(ocfs2_filesys *fs, int type,
+				      unsigned int *blk)
+{
+	errcode_t err;
+	char *buf;
+	struct qt_disk_dqdbheader *dh;
+	struct ocfs2_global_disk_dqinfo *info = &(fs->qinfo[type].qi_info);
+	ocfs2_cached_inode *ci = fs->qinfo[type].qi_inode;
+
+	err = ocfs2_malloc_block(fs->fs_io, &buf);
+	if (err)
+		return err;
+	dh = (struct qt_disk_dqdbheader *)buf;
+	if (info->dqi_free_blk) {
+		*blk = info->dqi_free_blk;
+		err = read_blk(fs, type, *blk, buf);
+		if (err)
+			goto bail;
+		info->dqi_free_blk = le32_to_cpu(dh->dqdh_next_free);
+	}
+	else {
+		if (info->dqi_blocks ==
+		    ocfs2_clusters_to_blocks(fs, ci->ci_inode->i_clusters)) {
+			err = ocfs2_cached_inode_extend_allocation(ci, 1);
+			if (err)
+				goto bail;
+		}
Quoted 8 lines

libocfs2/quota.c line 717

Quoted 3 lines
libocfs2/quota.c new file +3 -0
+		*blk = info->dqi_blocks++;
+		ci->ci_inode->i_size =
+				ocfs2_blocks_to_bytes(fs, info->dqi_blocks);

I am interested in this part. I read the kernel part yesterday. There you often check whether we need to add a chunk header in which case we need to extend the file by 2 blocks actually. But here we just extend 1 cluster? Is this a little different from the kernel part or we just simplify the case in the userspace? Please help me clarify it. Thanks.

This code takes care of extending global quota file - in kernel this
corresponds to a handling in ocfs2_quota_write(). Userspace code never needs to extend local quota files, it only initializes them.

Quoted 6 lines

libocfs2/quota.c line 723

Quoted 6 lines
libocfs2/quota.c new file +6 -0
+	}
+	mark_quotafile_info_dirty(fs, type);
+bail:
+	ocfs2_free(&buf);
+	return err;
+}

Honza

Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
author
#6 lore raw

PATCH 4/9 Write out quota info changes on ocfs2_close()

In reply to Jan Kara

We don't write out change of information in quota file header on each change, we rather cache it in ocfs2_filesys structure. So write out all the information when ocfs2_close() is called.

---
 libocfs2/closefs.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
libocfs2/closefs.c +12 -0
index 54411da..290bfd1 100644
@@ -39,6 +39,7 @@ errcode_t ocfs2_flush(ocfs2_filesys *fs)
 errcode_t ocfs2_close(ocfs2_filesys *fs)
 {
 	errcode_t ret;
+	int type;
 
 	if (fs->fs_flags & OCFS2_FLAG_DIRTY) {
 		ret = ocfs2_flush(fs);
@@ -46,6 +47,17 @@ errcode_t ocfs2_close(ocfs2_filesys *fs)
 			return ret;
 	}
 
+	for (type = 0; type < MAXQUOTAS; type++)
+		if (fs->qinfo[type].flags & OCFS2_QF_INFO_DIRTY) {
+			ret = ocfs2_write_global_quota_info(fs, type);
+			if (ret)
+				return ret;
+			ret = ocfs2_write_cached_inode(fs,
+						fs->qinfo[type].qi_inode);
+			if (ret)
+				return ret;
+		}
+
 	ocfs2_freefs(fs);
 	return 0;
 }
Signature · 1 line
1.6.0.2
author
#7 lore raw

PATCH 5/9 Quota support for fsck.ocfs2

In reply to Jan Kara

After the filesystem is fixed, scan quota files and try to gather as much information about set limits as possible. Then scan the filesystem to compute correct quota usage and dump all the gathered information into freshly created quota files.

---
 fsck.ocfs2/Makefile               |    2 +
 fsck.ocfs2/fsck.c                 |    9 +
 fsck.ocfs2/fsck.ocfs2.checks.8.in |   30 ++
 fsck.ocfs2/include/pass5.h        |   26 ++
 fsck.ocfs2/pass5.c                |  533 +++++++++++++++++++++++++++++++++++++
 5 files changed, 600 insertions(+), 0 deletions(-)
 create mode 100644 fsck.ocfs2/include/pass5.h
 create mode 100644 fsck.ocfs2/pass5.c
fsck.ocfs2/Makefile +2 -0
index 7f6e547..850e106 100644
@@ -28,6 +28,7 @@ CFILES =	fsck.c		\
 		pass2.c 	\
 		pass3.c 	\
 		pass4.c 	\
+		pass5.c		\
 		problem.c 	\
 		slot_recovery.c \
 		strings.c 	\
@@ -46,6 +47,7 @@ HFILES = 	include/fsck.h		\
 		include/pass2.h		\
 		include/pass3.h		\
 		include/pass4.h		\
+		include/pass5.h		\
 		include/problem.h	\
 		include/slot_recovery.h	\
 		include/strings.h	\
fsck.ocfs2/fsck.c +9 -0
index a686886..fe15783 100644
@@ -30,6 +30,8 @@
  * pass2.c: verify directory entries, record some linkage metadata
  * pass3.c: make sure all dirs are reachable
  * pass4.c: resolve inode's link counts, move disconnected inodes to lost+found
+ * pass5.c: load global quota file, merge node-local quota files to global
+ *          quota file, recompute quota usage and recreate quota files
  *
  * When hacking on this keep the following in mind:
  *
@@ -64,6 +66,7 @@
 #include "pass2.h"
 #include "pass3.h"
 #include "pass4.h"
+#include "pass5.h"
 #include "problem.h"
 #include "util.h"
 #include "slot_recovery.h"
@@ -917,6 +920,12 @@ int main(int argc, char **argv)
 		goto done;
 	}
 
+	ret = o2fsck_pass5(ost);
+	if (ret) {
+		com_err(whoami, ret, "while performing pass 5");
+		goto done;
+	}
+
 done:
 	if (ret)
 		fsck_mask |= FSCK_ERROR;
fsck.ocfs2/fsck.ocfs2.checks.8.in +30 -0
index 739b867..f70f48d 100644
@@ -851,6 +851,36 @@ does not match the number of buckets found by fsck.
 
 Answering yes will change this to the correct count.
 
+\" pass5.c
+
+.SS "QMAGIC_INVALID"
+The magic number in the header of quota file does not match the proper
+number.
+
+Answering yes will make fsck use values in the quota file header anyway.
+
+.SS "QTREE_BLK_INVALID"
+Block with references to other blocks with quota data is corrupted.
+
+Answering yes will make fsck use references in the block.
+
+.SS "DQBLK_INVALID"
+The structure with quota limits was found in a corrupted block.
+
+Answering yes will use the values of limits for the user / group.
+
+.SS "DUP_DQBLK_INVALID"
+The structure with quota limits was found in a corrupted block
+and fsck has already found quota limits for this user / group.
+
+Answering yes will use new values of limits for the user / group.
+
+.SS "DUP_DQBLK_VALID"
+The structure with quota limits was found in a correct block
+but fsck has already found quota limits for this user / group.
+
+Answering yes will use new values of limits for the user / group.
+
 .SH "SEE ALSO"
 .BR fsck.ocfs2(8)
 
fsck.ocfs2/include/pass5.h new file +26 -0
new file mode 100644
index 0000000..6c0fc13
@@ -0,0 +1,26 @@
+/* -*- mode: c; c-basic-offset: 8; -*-
+ * vim: noexpandtab sw=8 ts=8 sts=0:
+ *
+ * pass5.h
+ *
+ * Copyright (C) 2004, 2008 Oracle.  All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License version 2 as published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+#ifndef __O2FSCK_PASS5_H__
+#define __O2FSCK_PASS5_H__
+
+#include "fsck.h"
+
+errcode_t o2fsck_pass5(o2fsck_state *ost);
+
+#endif /* __O2FSCK_PASS4_H__ */
+
fsck.ocfs2/pass5.c new file +533 -0

533 lines not on this page · raw message

Signature · 1 line
1.6.0.2
author
#8 lore raw

PATCH 6/9 Quota support for mkfs.ocfs2

In reply to Jan Kara
---
 mkfs.ocfs2/mkfs.c          |  146 +++++++++++++++++++++++++++++++++++++++++++-
 mkfs.ocfs2/mkfs.h          |    1 +
 mkfs.ocfs2/mkfs.ocfs2.8.in |   16 +++++
 3 files changed, 162 insertions(+), 1 deletions(-)
mkfs.ocfs2/mkfs.c +145 -1
index 6acc6e6..031b8a6 100644
@@ -98,12 +98,16 @@ static SystemFileInfo system_files[] = {
 	{ "slot_map", SFI_OTHER, 1, S_IFREG | 0644 },
 	{ "heartbeat", SFI_HEARTBEAT, 1, S_IFREG | 0644 },
 	{ "global_bitmap", SFI_CLUSTER, 1, S_IFREG | 0644 },
+	{ "aquota.user", SFI_QUOTA, 1, S_IFREG | 0644 },
+	{ "aquota.group", SFI_QUOTA, 1, S_IFREG | 0644 },
 	{ "orphan_dir:%04d", SFI_OTHER, 0, S_IFDIR | 0755 },
 	{ "extent_alloc:%04d", SFI_CHAIN, 0, S_IFREG | 0644 },
 	{ "inode_alloc:%04d", SFI_CHAIN, 0, S_IFREG | 0644 },
 	{ "journal:%04d", SFI_JOURNAL, 0, S_IFREG | 0644 },
 	{ "local_alloc:%04d", SFI_LOCAL_ALLOC, 0, S_IFREG | 0644 },
-	{ "truncate_log:%04d", SFI_TRUNCATE_LOG, 0, S_IFREG | 0644 }
+	{ "truncate_log:%04d", SFI_TRUNCATE_LOG, 0, S_IFREG | 0644 },
+	{ "aquota.user:%04d", SFI_QUOTA, 0, S_IFREG | 0644 },
+	{ "aquota.group:%04d", SFI_QUOTA, 0, S_IFREG | 0644 },
 };
 
 struct fs_type_translation {
@@ -226,6 +230,23 @@ static void mkfs_init_dir_trailer(State *s, DirData *dir, void *buf)
 	}
 }
 
+/* Should we skip this inode because of features enabled / disabled? */
+static int feature_skip(State *s, int system_inode)
+{
+	switch (system_inode) {
+		case USER_QUOTA_SYSTEM_INODE:
+		case LOCAL_USER_QUOTA_SYSTEM_INODE:
+			return !(s->feature_flags.opt_ro_compat &
+					OCFS2_FEATURE_RO_COMPAT_USRQUOTA);
+		case GROUP_QUOTA_SYSTEM_INODE:
+		case LOCAL_GROUP_QUOTA_SYSTEM_INODE:
+			return !(s->feature_flags.opt_ro_compat &
+					OCFS2_FEATURE_RO_COMPAT_GRPQUOTA);
+		default:
+			return 0;
+	}
+}
+
 static inline uint32_t system_dir_bytes_needed(State *s)
 {
 	int each = OCFS2_DIR_REC_LEN(SYSTEM_FILE_NAME_MAX);
@@ -233,6 +254,114 @@ static inline uint32_t system_dir_bytes_needed(State *s)
 	return each * sys_blocks_needed(s->initial_slots);
 }
 
+static void format_quota_files(State *s, ocfs2_filesys *fs)
+{
+	errcode_t ret;
+	ocfs2_quota_hash *usr_hash = NULL, *grp_hash = NULL;
+
+	/* Write correct data into quota files */
+	if (!feature_skip(s, USER_QUOTA_SYSTEM_INODE)) {
+		ret = ocfs2_init_fs_quota_info(fs, USRQUOTA);
+		if (ret) {
+			com_err(s->progname, ret,
+				"while looking up global user quota file");
+			goto error;
+		}
+		fs->qinfo[USRQUOTA].flags = 0;
+		fs->qinfo[USRQUOTA].qi_info.dqi_syncms = OCFS2_DEF_QUOTA_SYNC;
+		fs->qinfo[USRQUOTA].qi_info.dqi_bgrace = OCFS2_DEF_BLOCK_GRACE;
+		fs->qinfo[USRQUOTA].qi_info.dqi_igrace = OCFS2_DEF_INODE_GRACE;
+
+		ret = ocfs2_new_quota_hash(&usr_hash);
+		if (ret) {
+			com_err(s->progname, ret,
+				"while creating user quota hash.");
+			goto error;
+		}
+		ret = ocfs2_init_global_quota_file(fs, USRQUOTA);
+		if (ret) {
+			com_err(s->progname, ret, "while creating global user "
+				"quota file");
+			goto error;
+		}
+		ret = ocfs2_init_local_quota_files(fs, USRQUOTA);
+		if (ret) {
+			com_err(s->progname, ret,
+				"while initializing local user quota files");
+			goto error;
+		}
+	}
+	if (!feature_skip(s, GROUP_QUOTA_SYSTEM_INODE)) {
+		ret = ocfs2_init_fs_quota_info(fs, GRPQUOTA);
+		if (ret) {
+			com_err(s->progname, ret,
+				"while looking up global group quota file");
+			goto error;
+		}
+		fs->qinfo[GRPQUOTA].flags = 0;
+		fs->qinfo[GRPQUOTA].qi_info.dqi_syncms = OCFS2_DEF_QUOTA_SYNC;
+		fs->qinfo[GRPQUOTA].qi_info.dqi_bgrace = OCFS2_DEF_BLOCK_GRACE;
+		fs->qinfo[GRPQUOTA].qi_info.dqi_igrace = OCFS2_DEF_INODE_GRACE;
+		ret = ocfs2_new_quota_hash(&grp_hash);
+		if (ret) {
+			com_err(s->progname, ret,
+				"while creating group quota hash.");
+			goto error;
+		}
+		ret = ocfs2_init_global_quota_file(fs, GRPQUOTA);
+		if (ret) {
+			com_err(s->progname, ret, "while creating global group "
+				"quota file");
+			goto error;
+		}
+
+		ret = ocfs2_init_local_quota_files(fs, GRPQUOTA);
+		if (ret) {
+			com_err(s->progname, ret,
+				"while initializing local group quota files");
+			goto error;
+		}
+	}
+
+	ret = ocfs2_compute_quota_usage(fs, usr_hash, grp_hash);
+	if (ret) {
+		com_err(s->progname, ret, "while computing quota usage");
+		goto error;
+	}
+	if (usr_hash) {
+		ret = ocfs2_write_release_dquots(fs, USRQUOTA, usr_hash);
+		if (ret) {
+			com_err(s->progname, ret,
+				"while writing user quota usage");
+			goto error;
+		}
+		ret = ocfs2_free_quota_hash(usr_hash);
+		if (ret) {
+			com_err(s->progname, ret,
+				"while releasing user quota hash");
+			goto error;
+		}
+	}
+	if (grp_hash) {
+		ret = ocfs2_write_release_dquots(fs, GRPQUOTA, grp_hash);
+		if (ret) {
+			com_err(s->progname, ret,
+				"while writing group quota usage");
+			goto error;
+		}
+		ret = ocfs2_free_quota_hash(grp_hash);
+		if (ret) {
+			com_err(s->progname, ret,
+				"while releasing group quota hash");
+			goto error;
+		}
+	}
+	return;
+error:
+	clear_both_ends(s);
+	exit(1);
+}
+
 static void finish_normal_format(State *s)
 {
 	errcode_t ret;
@@ -304,6 +433,14 @@ static void finish_normal_format(State *s)
 	if (!s->quiet)
 		printf("done\n");
 
+	if (!s->quiet)
+		printf("Formatting quota files: ");
+
+	format_quota_files(s, fs);
+
+	if (!s->quiet)
+		printf("done\n");
+
 	ocfs2_close(fs);
 }
 
@@ -471,6 +608,8 @@ main(int argc, char **argv)
 	for (i = 0; i < NUM_SYSTEM_INODES; i++) {
 		if (hb_dev_skip(s, i))
 			continue;
+		if (feature_skip(s, i))
+			continue;
 
 		num = (system_files[i].global) ? 1 : s->initial_slots;
 		for (j = 0; j < num; j++) {
@@ -529,6 +668,8 @@ main(int argc, char **argv)
 	for (i = 0; i < NUM_SYSTEM_INODES; i++) {
 		if (hb_dev_skip(s, i))
 			continue;
+		if (feature_skip(s, i))
+			continue;
 
 		num = system_files[i].global ? 1 : s->initial_slots;
 		for (j = 0; j < num; j++) {
@@ -2432,6 +2573,9 @@ init_record(State *s, SystemFileDiskRecord *rec, int type, int mode)
 	case SFI_TRUNCATE_LOG:
 		rec->flags |= OCFS2_DEALLOC_FL;
 		break;
+	case SFI_QUOTA:
+		rec->flags |= OCFS2_QUOTA_FL;
+		break;
 	case SFI_OTHER:
 		break;
 	}
mkfs.ocfs2/mkfs.h +1 -0
index bd8ac45..969e4df 100644
@@ -96,6 +96,7 @@ enum {
 	SFI_HEARTBEAT,
 	SFI_CHAIN,
 	SFI_TRUNCATE_LOG,
+	SFI_QUOTA,
 	SFI_OTHER
 };
 
mkfs.ocfs2/mkfs.ocfs2.8.in +16 -0
index 38433ee..d1f4011 100644
@@ -146,6 +146,22 @@ arbitrary binary data. Attributes can be attached to all types of inodes: regula
 symbolic links, device nodes, etc. This feature is required for users wanting to use extended security
 facilities like POSIX ACLs or SELinux.
 .RE
+.RS 1.2i
+.TP
+\fBusrquota\fR
+Enable user quota support. With this feature enabled, filesystem will track amount of space
+and number of inodes (files, directories, symbolic links) each user owns. It is then possible
+to limit the maximum amount of space or inodes user can have. See a documentation of
+quota-tools package for more details.
+.RE
+.RS 1.2i
+.TP
+\fBgrpquota\fR
+Enable group quota support. With this feature enabled, filesystem will track amount of space
+and number of inodes (files, directories, symbolic links) each group owns. It is then possible
+to limit the maximum amount of space or inodes user can have. See a documentation of
+quota-tools package for more details.
+.RE
 
 .TP
 \fB\-\-fs\-feature\-level=\fR\fR\fIfeature\-level\fR
Signature · 1 line
1.6.0.2
author
#9 lore raw

PATCH 7/9 Add quota support to tunefs.ocfs2

In reply to Jan Kara

Implement setting of quota feature via tunefs.ocfs2. Also properly create / delete local quota files when number of slots increases / decreases, update quota information when sparse feature gets disabled.

Implement setting of interval in which we sync changes in local quota file to the global quota file.

---
 tunefs.ocfs2/Makefile                     |    6 +-
 tunefs.ocfs2/feature_quota.c              |  418 +++++++++++++++++++++++++++++
 tunefs.ocfs2/feature_sparse_files.c       |   68 +++++-
 tunefs.ocfs2/ocfs2ne.c                    |   26 ++
 tunefs.ocfs2/op_features.c                |    4 +
 tunefs.ocfs2/op_set_quota_sync_interval.c |  170 ++++++++++++
 tunefs.ocfs2/op_set_slot_count.c          |   91 ++++++-
 7 files changed, 776 insertions(+), 7 deletions(-)
 create mode 100644 tunefs.ocfs2/feature_quota.c
 create mode 100644 tunefs.ocfs2/op_set_quota_sync_interval.c
tunefs.ocfs2/Makefile +4 -2
index fd244d8..d28da81 100644
@@ -24,7 +24,8 @@ OCFS2NE_FEATURES =			\
 	feature_metaecc			\
 	feature_sparse_files		\
 	feature_unwritten_extents	\
-	feature_xattr
+	feature_xattr			\
+	feature_quota
 
 OCFS2NE_OPERATIONS =			\
 	op_cloned_volume		\
@@ -36,7 +37,8 @@ OCFS2NE_OPERATIONS =			\
 	op_set_label			\
 	op_set_journal_size		\
 	op_set_slot_count		\
-	op_update_cluster_stack
+	op_update_cluster_stack		\
+	op_set_quota_sync_interval	\
 
 sbindir = $(root_sbindir)
 SBIN_PROGRAMS = tunefs.ocfs2
tunefs.ocfs2/feature_quota.c new file +418 -0

418 lines not on this page · raw message

tunefs.ocfs2/feature_sparse_files.c +64 -4

104 lines not on this page · raw message

tunefs.ocfs2/ocfs2ne.c +26 -0
index c9051a4..48760c6 100644
@@ -98,6 +98,8 @@ extern struct tunefs_operation set_label_op;
 extern struct tunefs_operation set_slot_count_op;
 extern struct tunefs_operation update_cluster_stack_op;
 extern struct tunefs_operation cloned_volume_op;
+extern struct tunefs_operation set_usrquota_sync_interval_op;
+extern struct tunefs_operation set_grpquota_sync_interval_op;
 
 /* List of operations we're going to run */
 static LIST_HEAD(tunefs_run_list);
@@ -583,6 +585,28 @@ static struct tunefs_option journal_option = {
 	.opt_handle	= handle_journal_arg,
 };
 
+static struct tunefs_option set_usrquota_sync_interval_option = {
+	.opt_option	= {
+		.name		= "usrquota-sync-interval",
+		.val		= 256,
+		.has_arg	= 1,
+	},
+	.opt_help	= "   --usrquota-sync-interval <interval>",
+	.opt_handle	= generic_handle_arg,
+	.opt_op		= &set_usrquota_sync_interval_op,
+};
+
+static struct tunefs_option set_grpquota_sync_interval_option = {
+	.opt_option	= {
+		.name		= "grpquota-sync-interval",
+		.val		= 257,
+		.has_arg	= 1,
+	},
+	.opt_help	= "   --grpquota-sync-interval <interval>",
+	.opt_handle	= generic_handle_arg,
+	.opt_op		= &set_grpquota_sync_interval_op,
+};
+
 /* The order here creates the order in print_usage() */
 static struct tunefs_option *options[] = {
 	&help_option,
@@ -603,6 +627,8 @@ static struct tunefs_option *options[] = {
 	&features_option,
 	&update_cluster_stack_option,
 	&cloned_volume_option,
+	&set_usrquota_sync_interval_option,
+	&set_grpquota_sync_interval_option,
 	&yes_option,
 	&no_option,
 	NULL,
tunefs.ocfs2/op_features.c +4 -0
index ee9442e..afcc1f4 100644
@@ -41,6 +41,8 @@ extern struct tunefs_feature metaecc_feature;
 extern struct tunefs_feature sparse_files_feature;
 extern struct tunefs_feature unwritten_extents_feature;
 extern struct tunefs_feature xattr_feature;
+extern struct tunefs_feature usrquota_feature;
+extern struct tunefs_feature grpquota_feature;
 
 /* List of features supported by ocfs2ne */
 static struct tunefs_feature *features[] = {
@@ -52,6 +54,8 @@ static struct tunefs_feature *features[] = {
 	&sparse_files_feature,
 	&unwritten_extents_feature,
 	&xattr_feature,
+	&usrquota_feature,
+	&grpquota_feature,
 	NULL,
 };
 
tunefs.ocfs2/op_set_quota_sync_interval.c new file +170 -0

170 lines not on this page · raw message

tunefs.ocfs2/op_set_slot_count.c +90 -1

127 lines not on this page · raw message

Signature · 1 line
1.6.0.2
author
#10 lore raw

PATCH 8/9 Change headers to reflect that quota is now fully supported.

In reply to Jan Kara
---
 include/ocfs2-kernel/ocfs2_fs.h |    4 +++-
 libocfs2/feature_string.c       |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
include/ocfs2-kernel/ocfs2_fs.h +3 -1
index f3c9b53..1650315 100644
@@ -96,7 +96,9 @@
 					 | OCFS2_FEATURE_INCOMPAT_USERSPACE_STACK \
 					 | OCFS2_FEATURE_INCOMPAT_META_ECC \
 					 | OCFS2_FEATURE_INCOMPAT_XATTR)
-#define OCFS2_FEATURE_RO_COMPAT_SUPP	OCFS2_FEATURE_RO_COMPAT_UNWRITTEN
+#define OCFS2_FEATURE_RO_COMPAT_SUPP	(OCFS2_FEATURE_RO_COMPAT_UNWRITTEN \
+					 | OCFS2_FEATURE_RO_COMPAT_USRQUOTA \
+					 | OCFS2_FEATURE_RO_COMPAT_GRPQUOTA)
 
 /*
  * Heartbeat-only devices are missing journals and other files.  The
libocfs2/feature_string.c +3 -1
index 18ae6e9..cf3a0dd 100644
@@ -76,7 +76,9 @@ static ocfs2_fs_options feature_level_defaults[] = {
 	 OCFS2_FEATURE_INCOMPAT_INLINE_DATA |
 	 OCFS2_FEATURE_INCOMPAT_META_ECC |
 	 OCFS2_FEATURE_INCOMPAT_XATTR,
-	 OCFS2_FEATURE_RO_COMPAT_UNWRITTEN}, /* OCFS2_FEATURE_LEVEL_MAX_FEATURES */
+	 OCFS2_FEATURE_RO_COMPAT_UNWRITTEN |
+	 OCFS2_FEATURE_RO_COMPAT_USRQUOTA |
+	 OCFS2_FEATURE_RO_COMPAT_GRPQUOTA }, /* OCFS2_FEATURE_LEVEL_MAX_FEATURES */
 };
 
 /* These are the features we support in mkfs/tunefs via --fs-features */
Signature · 1 line
1.6.0.2
author
#11 lore raw

PATCH 9/9 Fix tunefs space check when disabling SPARSE feature

In reply to Jan Kara

Tunefs missed addition of number clusters needed to fill holes when disabling SPARSE feature and hence the check whether there's enough space in the filesystem didn't work.

---
 tunefs.ocfs2/feature_sparse_files.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
tunefs.ocfs2/feature_sparse_files.c +1 -0
index 65db46b..e5b3dab 100644
@@ -321,6 +321,7 @@ static errcode_t hole_iterate(ocfs2_filesys *fs, struct ocfs2_dinode *di,
 
 	list_add_tail(&file->list, &ctxt->files);
 	ctxt->holecount += file->holes_num;
+	ctxt->more_clusters += file->hole_clusters;
 
 	tools_progress_step(ctxt->prog, 1);
 
Signature · 1 line
1.6.0.2
#12 lore raw

cover Quota support for ocfs2-tools (version 2)

In reply to Jan Kara
Quoted 4 lines · Jan Kara

this is the next version of quota support for quota tools. I've addressed all
the comments of Tao, Joel and others. Sparse feature disabling also correctly updates quota information now and the patch is merged into the tunefs support patch.

These look good to me. Can I get one more reviewer before I
merge them?

Joel

Signature · 8 lines
"Friends may come and go, but enemies accumulate." 
        - Thomas Jones

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127