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

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