[Pvfs2-cvs] commit by vilayann in pvfs2-1/patches: posix-statlite-fix.patch SERIES

CVS commit program cvs at parl.clemson.edu
Tue Aug 29 19:06:28 EDT 2006


Update of /projects/cvsroot/pvfs2-1/patches
In directory parlweb1:/tmp/cvs-serv368/patches

Modified Files:
      Tag: posix-extensions-branch
	SERIES 
Added Files:
      Tag: posix-extensions-branch
	posix-statlite-fix.patch 
Log Message:
Bug fixes with the statlite system call.
Also updated the SERIES file to indicate that a new kernel patch is needed for the statlite() thingie to work..



--- /dev/null	2004-06-24 14:04:38.000000000 -0400
+++ posix-statlite-fix.patch	2006-08-29 19:06:28.000000000 -0400
@@ -0,0 +1,125 @@
+diff -Naur --exclude-from=/home/vilayann/redhat/BUILD/kernel-2.6.16/exclude vanilla/fs/stat.c vanilla-new/fs/stat.c
+--- vanilla/fs/stat.c	2006-05-24 16:19:07.000000000 -0500
++++ vanilla-new/fs/stat.c	2006-08-29 17:58:48.000000000 -0500
+@@ -345,6 +345,15 @@
+ 	return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
+ }
+ 
++static long get_stat_lite_mask(struct stat_lite __user *statlitebuf)
++{
++	struct stat_lite tmp;
++
++	if (copy_from_user(&tmp,statlitebuf,sizeof(tmp)))
++		return -EFAULT;
++	return tmp.st_litemask;
++}
++
+ int cp_new_statlite(struct kstat_lite *stat_lite, struct stat_lite __user *statlitebuf)
+ {
+ 	struct stat_lite tmp;
+@@ -434,7 +443,13 @@
+ asmlinkage long sys_newstatlite(char __user *filename, struct stat_lite __user *statlitebuf)
+ {
+ 	struct kstat_lite stat_lite;
+-	int error = vfs_statlite_fd(AT_FDCWD, filename, &stat_lite);
++	int error;
++
++	stat_lite.lite_mask = get_stat_lite_mask(statlitebuf);
++	if (stat_lite.lite_mask < 0)
++		return stat_lite.lite_mask;
++
++	error = vfs_statlite_fd(AT_FDCWD, filename, &stat_lite);
+ 
+ 	if (!error)
+ 		error = cp_new_statlite(&stat_lite, statlitebuf);
+@@ -456,7 +471,13 @@
+ asmlinkage long sys_newlstatlite(char __user *filename, struct stat_lite __user *statlitebuf)
+ {
+ 	struct kstat_lite stat_lite;
+-	int error = vfs_lstatlite_fd(AT_FDCWD, filename, &stat_lite);
++	int error;
++	
++	stat_lite.lite_mask = get_stat_lite_mask(statlitebuf);
++	if (stat_lite.lite_mask < 0)
++		return stat_lite.lite_mask;
++
++	error = vfs_lstatlite_fd(AT_FDCWD, filename, &stat_lite);
+ 
+ 	if (!error)
+ 		error = cp_new_statlite(&stat_lite, statlitebuf);
+@@ -501,7 +522,13 @@
+ asmlinkage long sys_newfstatlite(unsigned int fd, struct stat_lite __user *statlitebuf)
+ {
+ 	struct kstat_lite stat_lite;
+-	int error = vfs_fstatlite(fd, &stat_lite);
++	int error;
++
++	stat_lite.lite_mask = get_stat_lite_mask(statlitebuf);
++	if (stat_lite.lite_mask < 0)
++		return stat_lite.lite_mask;
++
++	error = vfs_fstatlite(fd, &stat_lite);
+ 
+ 	if (!error)
+ 		error = cp_new_statlite(&stat_lite, statlitebuf);
+@@ -580,6 +607,15 @@
+ 	return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
+ }
+ 
++static long get_stat64_lite_mask(struct stat64_lite __user *statlitebuf)
++{
++	struct stat64_lite tmp;
++
++	if (copy_from_user(&tmp,statlitebuf,sizeof(tmp)))
++		return -EFAULT;
++	return tmp.st_litemask;
++}
++
+ long cp_new_stat64_lite(struct kstat_lite *stat_lite, struct stat64_lite __user *statlitebuf)
+ {
+ 	struct stat64_lite tmp;
+@@ -648,7 +684,13 @@
+ asmlinkage long sys_statlite64(char __user * filename, struct stat64_lite __user * statlitebuf)
+ {
+ 	struct kstat_lite stat_lite;
+-	int error = vfs_statlite(filename, &stat_lite);
++	int error;
++
++	stat_lite.lite_mask = get_stat64_lite_mask(statlitebuf);
++	if (stat_lite.lite_mask < 0)
++		return stat_lite.lite_mask;
++
++	error = vfs_statlite(filename, &stat_lite);
+ 
+ 	if (!error)
+ 		error = cp_new_stat64_lite(&stat_lite, statlitebuf);
+@@ -670,7 +712,13 @@
+ asmlinkage long sys_lstatlite64(char __user * filename, struct stat64_lite __user * statlitebuf)
+ {
+ 	struct kstat_lite stat_lite;
+-	int error = vfs_lstatlite(filename, &stat_lite);
++	int error;
++	
++	stat_lite.lite_mask = get_stat64_lite_mask(statlitebuf);
++	if (stat_lite.lite_mask < 0)
++		return stat_lite.lite_mask;
++
++	error = vfs_lstatlite(filename, &stat_lite);
+ 
+ 	if (!error)
+ 		error = cp_new_stat64_lite(&stat_lite, statlitebuf);
+@@ -692,7 +740,13 @@
+ asmlinkage long sys_fstatlite64(unsigned long fd, struct stat64_lite __user * statlitebuf)
+ {
+ 	struct kstat_lite stat_lite;
+-	int error = vfs_fstatlite(fd, &stat_lite);
++	int error;
++
++	stat_lite.lite_mask = get_stat64_lite_mask(statlitebuf);
++	if (stat_lite.lite_mask < 0)
++		return stat_lite.lite_mask;
++
++	error = vfs_fstatlite(fd, &stat_lite);
+ 
+ 	if (!error)
+ 		error = cp_new_stat64_lite(&stat_lite, statlitebuf);

Index: SERIES
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/patches/Attic/SERIES,v
diff -p -u -r1.1.2.3 -r1.1.2.4
--- SERIES	31 May 2006 02:12:26 -0000	1.1.2.3
+++ SERIES	29 Aug 2006 23:06:28 -0000	1.1.2.4
@@ -8,3 +8,4 @@ d) posix-direntplus.patch: This implemen
 of system calls and the corresponding VFS hooks for FS specific implementations.
 e) posix-readwritex.patch: Implements the sys call stubs for the readx/writex family of system calls and
 the corresponding VFS hooks for FS specific implementations.
+f) posix-statlite-fix.patch: Bug fix for the statlite system call.



More information about the Pvfs2-cvs mailing list