[PATCH 3/4] fs: kill invalid dentries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When a dentry becomes invalid we can safely kill it and free the
associated memory. This fixes a memory leakage in the tftp and nfs
code as these regularly declare a dentry as invalid.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 fs/fs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/fs.c b/fs/fs.c
index f24962d2a6..a9d2cc7088 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -1577,6 +1577,7 @@ static struct dentry *lookup_dcache(const struct qstr *name,
 			if (!error)
 				d_invalidate(dentry);
 			dput(dentry);
+			dentry_kill(dentry);
 			return ERR_PTR(error);
 		}
 	}

-- 
2.39.5





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux