diff mbox

orangefs: report attributes_mask and attributes for statx

Message ID 20180504190752.1704-1-martin@omnibond.com (mailing list archive)
State New, archived
Headers show

Commit Message

Martin Brandenburg May 4, 2018, 7:07 p.m. UTC
Reported-by: Becky Ligon <ligon@clemson.edu>
Signed-off-by: Martin Brandenburg <martin@omnibond.com>
Cc: hubcap@omnibond.com
---
 fs/orangefs/inode.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Ritesh Harjani May 7, 2018, 5:11 a.m. UTC | #1
Hi Martin,

On 5/5/2018 12:37 AM, Martin Brandenburg wrote:
> Reported-by: Becky Ligon <ligon@clemson.edu>
> Signed-off-by: Martin Brandenburg <martin@omnibond.com>
> Cc: hubcap@omnibond.com

Probably some commit message would help understand others(like me who 
are new at this) what this patch is about.
I could not follow your patch until I read about statx by (
git log --grep=STATX_ATTR_IMMUTABLE)

Thanks for your help!!


> ---
>   fs/orangefs/inode.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c
> index b583fbf90665..f301e4957659 100644
> --- a/fs/orangefs/inode.c
> +++ b/fs/orangefs/inode.c
> @@ -268,6 +268,13 @@ int orangefs_getattr(const struct path *path, struct kstat *stat,
>   		else
>   			stat->result_mask = STATX_BASIC_STATS &
>   			    ~STATX_SIZE;
> +
> +		stat->attributes_mask = STATX_ATTR_IMMUTABLE |
> +		    STATX_ATTR_APPEND;
> +		if (inode->i_flags & S_IMMUTABLE)
> +			stat->attributes |= STATX_ATTR_IMMUTABLE;
> +		if (inode->i_flags & S_APPEND)
> +			stat->attributes |= STATX_ATTR_APPEND;
>   	}
>   	return ret;
>   }
>
diff mbox

Patch

diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c
index b583fbf90665..f301e4957659 100644
--- a/fs/orangefs/inode.c
+++ b/fs/orangefs/inode.c
@@ -268,6 +268,13 @@  int orangefs_getattr(const struct path *path, struct kstat *stat,
 		else
 			stat->result_mask = STATX_BASIC_STATS &
 			    ~STATX_SIZE;
+
+		stat->attributes_mask = STATX_ATTR_IMMUTABLE |
+		    STATX_ATTR_APPEND;
+		if (inode->i_flags & S_IMMUTABLE)
+			stat->attributes |= STATX_ATTR_IMMUTABLE;
+		if (inode->i_flags & S_APPEND)
+			stat->attributes |= STATX_ATTR_APPEND;
 	}
 	return ret;
 }