All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: Corruption-framework: Include inode nlink field
@ 2017-01-03 15:34 Lakshmipathi.G
  2017-01-04 15:09 ` David Sterba
  0 siblings, 1 reply; 5+ messages in thread
From: Lakshmipathi.G @ 2017-01-03 15:34 UTC (permalink / raw)
  To: linux-btrfs

Will include other fields, if this gets accepted.

Signed-off-by: Lakshmipathi.G <Lakshmipathi.G@giis.co.in>
---
 btrfs-corrupt-block.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/btrfs-corrupt-block.c b/btrfs-corrupt-block.c
index 16680df..64376ca 100644
--- a/btrfs-corrupt-block.c
+++ b/btrfs-corrupt-block.c
@@ -309,6 +309,7 @@ enum btrfs_inode_field {
 	BTRFS_INODE_FIELD_ISIZE,
 	BTRFS_INODE_FIELD_NBYTES,
 	BTRFS_INODE_FIELD_BAD,
+	BTRFS_INODE_FIELD_NLINK,
 };
 
 enum btrfs_file_extent_field {
@@ -346,6 +347,8 @@ static enum btrfs_inode_field convert_inode_field(char *field)
 		return BTRFS_INODE_FIELD_ISIZE;
 	if (!strncmp(field, "nbytes", FIELD_BUF_LEN))
 		return BTRFS_INODE_FIELD_NBYTES;
+	if (!strncmp(field, "nlink", FIELD_BUF_LEN))
+		return BTRFS_INODE_FIELD_NLINK;
 	return BTRFS_INODE_FIELD_BAD;
 }
 
@@ -603,6 +606,11 @@ static int corrupt_inode(struct btrfs_trans_handle *trans,
 		bogus = generate_u64(orig);
 		btrfs_set_inode_nbytes(path->nodes[0], ei, bogus);
 		break;
+	case BTRFS_INODE_FIELD_NLINK:
+		orig = btrfs_inode_nlink(path->nodes[0], ei);
+		bogus = generate_u32(orig);
+		btrfs_set_inode_nlink(path->nodes[0], ei, bogus);
+		break;
 	default:
 		ret = -EINVAL;
 		break;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] btrfs-progs: Corruption-framework: Include inode nlink field
  2017-01-03 15:34 [PATCH] btrfs-progs: Corruption-framework: Include inode nlink field Lakshmipathi.G
@ 2017-01-04 15:09 ` David Sterba
  0 siblings, 0 replies; 5+ messages in thread
From: David Sterba @ 2017-01-04 15:09 UTC (permalink / raw)
  To: Lakshmipathi.G; +Cc: linux-btrfs

On Tue, Jan 03, 2017 at 04:34:31PM +0100, Lakshmipathi.G wrote:
> Will include other fields, if this gets accepted.
> 
> Signed-off-by: Lakshmipathi.G <Lakshmipathi.G@giis.co.in>
> ---
>  btrfs-corrupt-block.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/btrfs-corrupt-block.c b/btrfs-corrupt-block.c
> index 16680df..64376ca 100644
> --- a/btrfs-corrupt-block.c
> +++ b/btrfs-corrupt-block.c
> @@ -309,6 +309,7 @@ enum btrfs_inode_field {
>  	BTRFS_INODE_FIELD_ISIZE,
>  	BTRFS_INODE_FIELD_NBYTES,
>  	BTRFS_INODE_FIELD_BAD,
> +	BTRFS_INODE_FIELD_NLINK,

This has to be before BTRFS_INODE_FIELD_BAD, as it's a not-so obvious
end of field sequence maker.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] btrfs-progs: Corruption-framework: Include inode nlink field
  2017-01-05 10:08 Lakshmipathi.G
@ 2017-01-17 14:52 ` David Sterba
  0 siblings, 0 replies; 5+ messages in thread
From: David Sterba @ 2017-01-17 14:52 UTC (permalink / raw)
  To: Lakshmipathi.G; +Cc: linux-btrfs, dsterba

On Thu, Jan 05, 2017 at 11:08:32AM +0100, Lakshmipathi.G wrote:
> Patch with fix for David Sterba review comment.
> 
> Signed-off-by: Lakshmipathi.G <Lakshmipathi.G@giis.co.in>

Applied, thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] btrfs-progs: Corruption-framework: Include inode nlink field
@ 2017-01-05 10:08 Lakshmipathi.G
  2017-01-17 14:52 ` David Sterba
  0 siblings, 1 reply; 5+ messages in thread
From: Lakshmipathi.G @ 2017-01-05 10:08 UTC (permalink / raw)
  To: linux-btrfs, dsterba

Patch with fix for David Sterba review comment.

Signed-off-by: Lakshmipathi.G <Lakshmipathi.G@giis.co.in>
---
 btrfs-corrupt-block.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/btrfs-corrupt-block.c b/btrfs-corrupt-block.c
index 16680df..a2f35ab 100644
--- a/btrfs-corrupt-block.c
+++ b/btrfs-corrupt-block.c
@@ -308,6 +308,7 @@ static void btrfs_corrupt_extent_tree(struct btrfs_trans_handle *trans,
 enum btrfs_inode_field {
 	BTRFS_INODE_FIELD_ISIZE,
 	BTRFS_INODE_FIELD_NBYTES,
+	BTRFS_INODE_FIELD_NLINK,
 	BTRFS_INODE_FIELD_BAD,
 };
 
@@ -346,6 +347,8 @@ static enum btrfs_inode_field convert_inode_field(char *field)
 		return BTRFS_INODE_FIELD_ISIZE;
 	if (!strncmp(field, "nbytes", FIELD_BUF_LEN))
 		return BTRFS_INODE_FIELD_NBYTES;
+	if (!strncmp(field, "nlink", FIELD_BUF_LEN))
+		return BTRFS_INODE_FIELD_NLINK;
 	return BTRFS_INODE_FIELD_BAD;
 }
 
@@ -603,6 +606,11 @@ static int corrupt_inode(struct btrfs_trans_handle *trans,
 		bogus = generate_u64(orig);
 		btrfs_set_inode_nbytes(path->nodes[0], ei, bogus);
 		break;
+	case BTRFS_INODE_FIELD_NLINK:
+		orig = btrfs_inode_nlink(path->nodes[0], ei);
+		bogus = generate_u32(orig);
+		btrfs_set_inode_nlink(path->nodes[0], ei, bogus);
+		break;
 	default:
 		ret = -EINVAL;
 		break;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] btrfs-progs: Corruption-framework: Include inode nlink field
@ 2017-01-03 12:13 Lakshmipathi.G
  0 siblings, 0 replies; 5+ messages in thread
From: Lakshmipathi.G @ 2017-01-03 12:13 UTC (permalink / raw)
  To: linux-btrfs

Will include other fields, if this gets accepted.


Signed-off-by: Lakshmipathi.G <Lakshmipathi.G@giis.co.in>
---
 btrfs-corrupt-block.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/btrfs-corrupt-block.c b/btrfs-corrupt-block.c
index 16680df..64376ca 100644
--- a/btrfs-corrupt-block.c
+++ b/btrfs-corrupt-block.c
@@ -309,6 +309,7 @@ enum btrfs_inode_field {
 	BTRFS_INODE_FIELD_ISIZE,
 	BTRFS_INODE_FIELD_NBYTES,
 	BTRFS_INODE_FIELD_BAD,
+	BTRFS_INODE_FIELD_NLINK,
 };
 
 enum btrfs_file_extent_field {
@@ -346,6 +347,8 @@ static enum btrfs_inode_field convert_inode_field(char *field)
 		return BTRFS_INODE_FIELD_ISIZE;
 	if (!strncmp(field, "nbytes", FIELD_BUF_LEN))
 		return BTRFS_INODE_FIELD_NBYTES;
+	if (!strncmp(field, "nlink", FIELD_BUF_LEN))
+		return BTRFS_INODE_FIELD_NLINK;
 	return BTRFS_INODE_FIELD_BAD;
 }
 
@@ -603,6 +606,11 @@ static int corrupt_inode(struct btrfs_trans_handle *trans,
 		bogus = generate_u64(orig);
 		btrfs_set_inode_nbytes(path->nodes[0], ei, bogus);
 		break;
+	case BTRFS_INODE_FIELD_NLINK:
+		orig = btrfs_inode_nlink(path->nodes[0], ei);
+		bogus = generate_u32(orig);
+		btrfs_set_inode_nlink(path->nodes[0], ei, bogus);
+		break;
 	default:
 		ret = -EINVAL;
 		break;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-01-17 14:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-03 15:34 [PATCH] btrfs-progs: Corruption-framework: Include inode nlink field Lakshmipathi.G
2017-01-04 15:09 ` David Sterba
  -- strict thread matches above, loose matches on Subject: below --
2017-01-05 10:08 Lakshmipathi.G
2017-01-17 14:52 ` David Sterba
2017-01-03 12:13 Lakshmipathi.G

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.