LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 1/3] eCryptfs: set O_LARGEFILE when opening lower file
@ 2007-02-23  0:38 Michael Halcrow
  2007-02-23  0:39 ` [PATCH 2/3] eCryptfs: remove unnecessary flush_dcache_page() Michael Halcrow
  2007-02-23  0:40 ` [PATCH 3/3] eCryptfs: no path_release() after path_lookup() error Michael Halcrow
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Halcrow @ 2007-02-23  0:38 UTC (permalink / raw)
  To: Andrew Morton; +Cc: mhalcrow, LKML

Dmitriy Monakhov <dmonakhov@openvz.org> wrote:
> Lets explicitly add O_LARGEFILE to opened lower file flags as it
> done in unionfs and nfsd. Also remove unnecessery #define from
> ecryptfs_initialize_file().

O_LARGEFILE should be set here when opening the lower file.

Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com>
---
 fs/ecryptfs/file.c  |    1 +
 fs/ecryptfs/inode.c |    3 ---
 2 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c
index bd969ad..7a7d25d 100644
--- a/fs/ecryptfs/file.c
+++ b/fs/ecryptfs/file.c
@@ -205,6 +205,7 @@ int ecryptfs_open_lower_file(struct file **lower_file,
 {
 	int rc = 0;
 
+	flags |= O_LARGEFILE;
 	dget(lower_dentry);
 	mntget(lower_mnt);
 	*lower_file = dentry_open(lower_dentry, lower_mnt, flags);
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
index cf02a66..1b12e49 100644
--- a/fs/ecryptfs/inode.c
+++ b/fs/ecryptfs/inode.c
@@ -200,9 +200,6 @@ static int ecryptfs_initialize_file(struct dentry *ecryptfs_dentry)
 	inode = ecryptfs_dentry->d_inode;
 	crypt_stat = &ecryptfs_inode_to_private(inode)->crypt_stat;
 	lower_flags = ((O_CREAT | O_TRUNC) & O_ACCMODE) | O_RDWR;
-#if BITS_PER_LONG != 32
-	lower_flags |= O_LARGEFILE;
-#endif
 	lower_mnt = ecryptfs_dentry_to_lower_mnt(ecryptfs_dentry);
 	/* Corresponding fput() at end of this function */
 	if ((rc = ecryptfs_open_lower_file(&lower_file, lower_dentry, lower_mnt,
-- 
1.4.4.4


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

* [PATCH 2/3] eCryptfs: remove unnecessary flush_dcache_page()
  2007-02-23  0:38 [PATCH 1/3] eCryptfs: set O_LARGEFILE when opening lower file Michael Halcrow
@ 2007-02-23  0:39 ` Michael Halcrow
  2007-02-23  0:40 ` [PATCH 3/3] eCryptfs: no path_release() after path_lookup() error Michael Halcrow
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Halcrow @ 2007-02-23  0:39 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML

Remove unnecessary flush_dcache_page() call. Thanks to Dmitriy
Monakhov for pointing this out.

Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com>
---
 fs/ecryptfs/mmap.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c
index 842497d..2a65914 100644
--- a/fs/ecryptfs/mmap.c
+++ b/fs/ecryptfs/mmap.c
@@ -238,7 +238,6 @@ int ecryptfs_do_readpage(struct file *file, struct page *page,
 	lower_page_data = kmap_atomic(lower_page, KM_USER1);
 	memcpy(page_data, lower_page_data, PAGE_CACHE_SIZE);
 	kunmap_atomic(lower_page_data, KM_USER1);
-	flush_dcache_page(lower_page);
 	kunmap_atomic(page_data, KM_USER0);
 	flush_dcache_page(page);
 	rc = 0;
-- 
1.4.4.4


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

* [PATCH 3/3] eCryptfs: no path_release() after path_lookup() error
  2007-02-23  0:38 [PATCH 1/3] eCryptfs: set O_LARGEFILE when opening lower file Michael Halcrow
  2007-02-23  0:39 ` [PATCH 2/3] eCryptfs: remove unnecessary flush_dcache_page() Michael Halcrow
@ 2007-02-23  0:40 ` Michael Halcrow
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Halcrow @ 2007-02-23  0:40 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML

Dmitriy Monakhov wrote:
> if path_lookup() return non zero code we don't have to worry about
> 'nd' parameter, but ecryptfs_read_super does path_release(&nd) after
> path_lookup has failed, and dentry counter becomes negative

Do not do a path_release after a path_lookup error.

Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com>
---
 fs/ecryptfs/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
index 80044d1..812427e 100644
--- a/fs/ecryptfs/main.c
+++ b/fs/ecryptfs/main.c
@@ -487,7 +487,7 @@ static int ecryptfs_read_super(struct super_block *sb, const char *dev_name)
 	rc = path_lookup(dev_name, LOOKUP_FOLLOW, &nd);
 	if (rc) {
 		ecryptfs_printk(KERN_WARNING, "path_lookup() failed\n");
-		goto out_free;
+		goto out;
 	}
 	lower_root = nd.dentry;
 	if (!lower_root->d_inode) {
-- 
1.4.4.4


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

end of thread, other threads:[~2007-02-23  0:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-23  0:38 [PATCH 1/3] eCryptfs: set O_LARGEFILE when opening lower file Michael Halcrow
2007-02-23  0:39 ` [PATCH 2/3] eCryptfs: remove unnecessary flush_dcache_page() Michael Halcrow
2007-02-23  0:40 ` [PATCH 3/3] eCryptfs: no path_release() after path_lookup() error Michael Halcrow

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).