linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH V3] fs: befs: Insert NULL inode to dentry
@ 2016-07-27  2:35 Salah Triki
  2016-07-27 15:27 ` Luis de Bethencourt
  0 siblings, 1 reply; 2+ messages in thread
From: Salah Triki @ 2016-07-27  2:35 UTC (permalink / raw)
  To: viro
  Cc: luisbg, akpm, mhocko, vdavydov, linux-fsdevel, linux-kernel,
	salah.triki

As VFS expects, lookup inserts NULL inode to dentry when the named inode
does not exist.

Signed-off-by: Salah Triki <salah.triki@gmail.com>
---
 fs/befs/linuxvfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index c734f21..2fea87b 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -184,6 +184,7 @@ befs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
 
 	if (ret == BEFS_BT_NOT_FOUND) {
 		befs_debug(sb, "<--- %s %pd not found", __func__, dentry);
+		d_add(dentry, NULL);
 		return ERR_PTR(-ENOENT);
 
 	} else if (ret != BEFS_OK || offset == 0) {
-- 
1.9.1


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

* Re: [RESEND PATCH V3] fs: befs: Insert NULL inode to dentry
  2016-07-27  2:35 [RESEND PATCH V3] fs: befs: Insert NULL inode to dentry Salah Triki
@ 2016-07-27 15:27 ` Luis de Bethencourt
  0 siblings, 0 replies; 2+ messages in thread
From: Luis de Bethencourt @ 2016-07-27 15:27 UTC (permalink / raw)
  To: Salah Triki, viro; +Cc: akpm, mhocko, vdavydov, linux-fsdevel, linux-kernel

On 27/07/16 03:35, Salah Triki wrote:
> As VFS expects, lookup inserts NULL inode to dentry when the named inode
> does not exist.
> 
> Signed-off-by: Salah Triki <salah.triki@gmail.com>
> ---
>  fs/befs/linuxvfs.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
> index c734f21..2fea87b 100644
> --- a/fs/befs/linuxvfs.c
> +++ b/fs/befs/linuxvfs.c
> @@ -184,6 +184,7 @@ befs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
>  
>  	if (ret == BEFS_BT_NOT_FOUND) {
>  		befs_debug(sb, "<--- %s %pd not found", __func__, dentry);
> +		d_add(dentry, NULL);
>  		return ERR_PTR(-ENOENT);
>  
>  	} else if (ret != BEFS_OK || offset == 0) {
> 

Hi,

The expectation Salah is mentioning can be seen in
Documentation/filesystems/vfs.txt:383
"If the named inode does not exist a NULL inode should be inserted
into the dentry (this is called a negative dentry)."

Acked-by: Luis de Bethencourt <luisbg@osg.samsung.com>

I have applied this patch into [0]:
https://github.com/luisbg/linux-befs/tree/befs-next

Thanks,
Luis





[0] reason for the git branch: https://lkml.org/lkml/2016/7/26/533

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

end of thread, other threads:[~2016-07-27 15:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-27  2:35 [RESEND PATCH V3] fs: befs: Insert NULL inode to dentry Salah Triki
2016-07-27 15:27 ` Luis de Bethencourt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).