public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] fsnotify/fdinfo: use named constants instead of hardcoded values
@ 2014-09-02  8:00 Andrey Vagin
  2014-09-02  8:00 ` [PATCH 2/2] fs/notify: don't show f_handle if exportfs_encode_inode_fh failed Andrey Vagin
  2014-09-02  8:14 ` [PATCH 1/2] fsnotify/fdinfo: use named constants instead of hardcoded values Cyrill Gorcunov
  0 siblings, 2 replies; 5+ messages in thread
From: Andrey Vagin @ 2014-09-02  8:00 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrey Vagin, Cyrill Gorcunov, Alexander Viro, Andrew Morton

MAX_HANDLE_SZ is equal to 128, but currently the size of pad is only 64
bytes, so exportfs_encode_inode_fh can return an error.

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
---
 fs/notify/fdinfo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/notify/fdinfo.c b/fs/notify/fdinfo.c
index 238a593..660d33b 100644
--- a/fs/notify/fdinfo.c
+++ b/fs/notify/fdinfo.c
@@ -42,7 +42,7 @@ static int show_mark_fhandle(struct seq_file *m, struct inode *inode)
 {
 	struct {
 		struct file_handle handle;
-		u8 pad[64];
+		u8 pad[MAX_HANDLE_SZ];
 	} f;
 	int size, ret, i;
 
@@ -50,7 +50,7 @@ static int show_mark_fhandle(struct seq_file *m, struct inode *inode)
 	size = f.handle.handle_bytes >> 2;
 
 	ret = exportfs_encode_inode_fh(inode, (struct fid *)f.handle.f_handle, &size, 0);
-	if ((ret == 255) || (ret == -ENOSPC)) {
+	if ((ret == FILEID_INVALID) || (ret == -ENOSPC)) {
 		WARN_ONCE(1, "Can't encode file handler for inotify: %d\n", ret);
 		return 0;
 	}
-- 
1.9.3


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

* [PATCH 2/2] fs/notify: don't show f_handle if exportfs_encode_inode_fh failed
  2014-09-02  8:00 [PATCH 1/2] fsnotify/fdinfo: use named constants instead of hardcoded values Andrey Vagin
@ 2014-09-02  8:00 ` Andrey Vagin
  2014-09-02  8:14   ` Cyrill Gorcunov
  2014-09-02  8:14 ` [PATCH 1/2] fsnotify/fdinfo: use named constants instead of hardcoded values Cyrill Gorcunov
  1 sibling, 1 reply; 5+ messages in thread
From: Andrey Vagin @ 2014-09-02  8:00 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrey Vagin, Cyrill Gorcunov, Alexander Viro, Andrew Morton

Currently we handle only ENOSPC. In case of other errors the file_handle
variable isn't filled properly and we will show a part of stack.

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
---
 fs/notify/fdinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/notify/fdinfo.c b/fs/notify/fdinfo.c
index 660d33b..9d7e2b9 100644
--- a/fs/notify/fdinfo.c
+++ b/fs/notify/fdinfo.c
@@ -50,7 +50,7 @@ static int show_mark_fhandle(struct seq_file *m, struct inode *inode)
 	size = f.handle.handle_bytes >> 2;
 
 	ret = exportfs_encode_inode_fh(inode, (struct fid *)f.handle.f_handle, &size, 0);
-	if ((ret == FILEID_INVALID) || (ret == -ENOSPC)) {
+	if ((ret == FILEID_INVALID) || (ret < 0)) {
 		WARN_ONCE(1, "Can't encode file handler for inotify: %d\n", ret);
 		return 0;
 	}
-- 
1.9.3


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

* Re: [PATCH 1/2] fsnotify/fdinfo: use named constants instead of hardcoded values
  2014-09-02  8:00 [PATCH 1/2] fsnotify/fdinfo: use named constants instead of hardcoded values Andrey Vagin
  2014-09-02  8:00 ` [PATCH 2/2] fs/notify: don't show f_handle if exportfs_encode_inode_fh failed Andrey Vagin
@ 2014-09-02  8:14 ` Cyrill Gorcunov
  2014-09-02  8:19   ` Cyrill Gorcunov
  1 sibling, 1 reply; 5+ messages in thread
From: Cyrill Gorcunov @ 2014-09-02  8:14 UTC (permalink / raw)
  To: Andrey Vagin; +Cc: linux-kernel, Alexander Viro, Andrew Morton

On Tue, Sep 02, 2014 at 12:00:14PM +0400, Andrey Vagin wrote:
> MAX_HANDLE_SZ is equal to 128, but currently the size of pad is only 64
> bytes, so exportfs_encode_inode_fh can return an error.
> 
> Cc: Cyrill Gorcunov <gorcunov@openvz.org>
> Cc: Alexander Viro <viro@zeniv.linux.org.uk>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>

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

* Re: [PATCH 2/2] fs/notify: don't show f_handle if exportfs_encode_inode_fh failed
  2014-09-02  8:00 ` [PATCH 2/2] fs/notify: don't show f_handle if exportfs_encode_inode_fh failed Andrey Vagin
@ 2014-09-02  8:14   ` Cyrill Gorcunov
  0 siblings, 0 replies; 5+ messages in thread
From: Cyrill Gorcunov @ 2014-09-02  8:14 UTC (permalink / raw)
  To: Andrey Vagin; +Cc: linux-kernel, Alexander Viro, Andrew Morton

On Tue, Sep 02, 2014 at 12:00:15PM +0400, Andrey Vagin wrote:
> Currently we handle only ENOSPC. In case of other errors the file_handle
> variable isn't filled properly and we will show a part of stack.
> 
> Cc: Cyrill Gorcunov <gorcunov@openvz.org>
> Cc: Alexander Viro <viro@zeniv.linux.org.uk>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>

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

* Re: [PATCH 1/2] fsnotify/fdinfo: use named constants instead of hardcoded values
  2014-09-02  8:14 ` [PATCH 1/2] fsnotify/fdinfo: use named constants instead of hardcoded values Cyrill Gorcunov
@ 2014-09-02  8:19   ` Cyrill Gorcunov
  0 siblings, 0 replies; 5+ messages in thread
From: Cyrill Gorcunov @ 2014-09-02  8:19 UTC (permalink / raw)
  To: Andrey Vagin; +Cc: linux-kernel, Alexander Viro, Andrew Morton, stable

On Tue, Sep 02, 2014 at 12:14:08PM +0400, Cyrill Gorcunov wrote:
> On Tue, Sep 02, 2014 at 12:00:14PM +0400, Andrey Vagin wrote:
> > MAX_HANDLE_SZ is equal to 128, but currently the size of pad is only 64
> > bytes, so exportfs_encode_inode_fh can return an error.
> > 
> > Cc: Cyrill Gorcunov <gorcunov@openvz.org>
> > Cc: Alexander Viro <viro@zeniv.linux.org.uk>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Signed-off-by: Andrey Vagin <avagin@openvz.org>
> Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>

Btw, I think both are good candidates for @stable.

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

end of thread, other threads:[~2014-09-02  8:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-02  8:00 [PATCH 1/2] fsnotify/fdinfo: use named constants instead of hardcoded values Andrey Vagin
2014-09-02  8:00 ` [PATCH 2/2] fs/notify: don't show f_handle if exportfs_encode_inode_fh failed Andrey Vagin
2014-09-02  8:14   ` Cyrill Gorcunov
2014-09-02  8:14 ` [PATCH 1/2] fsnotify/fdinfo: use named constants instead of hardcoded values Cyrill Gorcunov
2014-09-02  8:19   ` Cyrill Gorcunov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox