aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/linux-2.6/xfs_ioctl.c4
-rw-r--r--fs/xfs/linux-2.6/xfs_vfs.h2
-rw-r--r--fs/xfs/xfs_error.c20
-rw-r--r--fs/xfs/xfs_error.h5
-rw-r--r--fs/xfs/xfs_mount.c22
5 files changed, 12 insertions, 41 deletions
diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c
index 4c38e27ed184..c9b0c9e68139 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -138,7 +138,7 @@ xfs_find_handle(
138 vp = vn_from_inode(inode); 138 vp = vn_from_inode(inode);
139 139
140 /* now we can grab the fsid */ 140 /* now we can grab the fsid */
141 memcpy(&handle.ha_fsid, XFS_MTOVFS(XFS_I(inode)->i_mount)->vfs_altfsid, 141 memcpy(&handle.ha_fsid, XFS_I(inode)->i_mount->m_fixedfsid,
142 sizeof(xfs_fsid_t)); 142 sizeof(xfs_fsid_t));
143 hsize = sizeof(xfs_fsid_t); 143 hsize = sizeof(xfs_fsid_t);
144 144
@@ -966,7 +966,7 @@ xfs_ioctl(
966 if (!capable(CAP_SYS_ADMIN)) 966 if (!capable(CAP_SYS_ADMIN))
967 return -EPERM; 967 return -EPERM;
968 968
969 error = xfs_errortag_clearall(mp); 969 error = xfs_errortag_clearall(mp, 1);
970 return -error; 970 return -error;
971 971
972 default: 972 default:
diff --git a/fs/xfs/linux-2.6/xfs_vfs.h b/fs/xfs/linux-2.6/xfs_vfs.h
index 04303cb911c7..943f581bdb47 100644
--- a/fs/xfs/linux-2.6/xfs_vfs.h
+++ b/fs/xfs/linux-2.6/xfs_vfs.h
@@ -44,8 +44,6 @@ typedef struct bhv_vfs_sync_work {
44typedef struct bhv_vfs { 44typedef struct bhv_vfs {
45 struct xfs_mount *vfs_mount; 45 struct xfs_mount *vfs_mount;
46 u_int vfs_flag; /* flags */ 46 u_int vfs_flag; /* flags */
47 xfs_fsid_t vfs_fsid; /* file system ID */
48 xfs_fsid_t *vfs_altfsid; /* An ID fixed for life of FS */
49 struct super_block *vfs_super; /* generic superblock pointer */ 47 struct super_block *vfs_super; /* generic superblock pointer */
50 struct task_struct *vfs_sync_task; /* generalised sync thread */ 48 struct task_struct *vfs_sync_task; /* generalised sync thread */
51 bhv_vfs_sync_work_t vfs_sync_work; /* work item for VFS_SYNC */ 49 bhv_vfs_sync_work_t vfs_sync_work; /* work item for VFS_SYNC */
diff --git a/fs/xfs/xfs_error.c b/fs/xfs/xfs_error.c
index 339f9d4a49cd..a4634d94e561 100644
--- a/fs/xfs/xfs_error.c
+++ b/fs/xfs/xfs_error.c
@@ -133,10 +133,14 @@ xfs_errortag_add(int error_tag, xfs_mount_t *mp)
133} 133}
134 134
135int 135int
136xfs_errortag_clearall_umount(int64_t fsid, char *fsname, int loud) 136xfs_errortag_clearall(xfs_mount_t *mp, int loud)
137{ 137{
138 int i; 138 int64_t fsid;
139 int cleared = 0; 139 int cleared = 0;
140 int i;
141
142 memcpy(&fsid, mp->m_fixedfsid, sizeof(xfs_fsid_t));
143
140 144
141 for (i = 0; i < XFS_NUM_INJECT_ERROR; i++) { 145 for (i = 0; i < XFS_NUM_INJECT_ERROR; i++) {
142 if ((fsid == 0LL || xfs_etest_fsid[i] == fsid) && 146 if ((fsid == 0LL || xfs_etest_fsid[i] == fsid) &&
@@ -155,20 +159,10 @@ xfs_errortag_clearall_umount(int64_t fsid, char *fsname, int loud)
155 if (loud || cleared) 159 if (loud || cleared)
156 cmn_err(CE_WARN, 160 cmn_err(CE_WARN,
157 "Cleared all XFS error tags for filesystem \"%s\"", 161 "Cleared all XFS error tags for filesystem \"%s\"",
158 fsname); 162 mp->m_fsname);
159 163
160 return 0; 164 return 0;
161} 165}
162
163int
164xfs_errortag_clearall(xfs_mount_t *mp)
165{
166 int64_t fsid;
167
168 memcpy(&fsid, mp->m_fixedfsid, sizeof(xfs_fsid_t));
169
170 return xfs_errortag_clearall_umount(fsid, mp->m_fsname, 1);
171}
172#endif /* DEBUG || INDUCE_IO_ERROR */ 166#endif /* DEBUG || INDUCE_IO_ERROR */
173 167
174static void 168static void
diff --git a/fs/xfs/xfs_error.h b/fs/xfs/xfs_error.h
index 5599ada456a1..10e9d9619ae5 100644
--- a/fs/xfs/xfs_error.h
+++ b/fs/xfs/xfs_error.h
@@ -144,12 +144,11 @@ extern void xfs_error_test_init(void);
144#endif /* __ANSI_CPP__ */ 144#endif /* __ANSI_CPP__ */
145 145
146extern int xfs_errortag_add(int error_tag, xfs_mount_t *mp); 146extern int xfs_errortag_add(int error_tag, xfs_mount_t *mp);
147extern int xfs_errortag_clearall(xfs_mount_t *mp); 147extern int xfs_errortag_clearall(xfs_mount_t *mp, int loud);
148extern int xfs_errortag_clearall_umount(int64_t fsid, char *fsname, int loud);
149#else 148#else
150#define XFS_TEST_ERROR(expr, mp, tag, rf) (expr) 149#define XFS_TEST_ERROR(expr, mp, tag, rf) (expr)
151#define xfs_errortag_add(tag, mp) (ENOSYS) 150#define xfs_errortag_add(tag, mp) (ENOSYS)
152#define xfs_errortag_clearall(mp) (ENOSYS) 151#define xfs_errortag_clearall(mp, loud) (ENOSYS)
153#endif /* (DEBUG || INDUCE_IO_ERROR) */ 152#endif /* (DEBUG || INDUCE_IO_ERROR) */
154 153
155/* 154/*
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 4f3488a7dc06..87bc9280b786 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -875,14 +875,11 @@ xfs_mountfs(
875 */ 875 */
876 if ((mfsi_flags & XFS_MFSI_SECOND) == 0 && 876 if ((mfsi_flags & XFS_MFSI_SECOND) == 0 &&
877 (mp->m_flags & XFS_MOUNT_NOUUID) == 0) { 877 (mp->m_flags & XFS_MOUNT_NOUUID) == 0) {
878 __uint64_t ret64;
879 if (xfs_uuid_mount(mp)) { 878 if (xfs_uuid_mount(mp)) {
880 error = XFS_ERROR(EINVAL); 879 error = XFS_ERROR(EINVAL);
881 goto error1; 880 goto error1;
882 } 881 }
883 uuid_mounted=1; 882 uuid_mounted=1;
884 ret64 = uuid_hash64(&sbp->sb_uuid);
885 memcpy(&vfsp->vfs_fsid, &ret64, sizeof(ret64));
886 } 883 }
887 884
888 /* 885 /*
@@ -1007,16 +1004,6 @@ xfs_mountfs(
1007 */ 1004 */
1008 uuid_getnodeuniq(&sbp->sb_uuid, mp->m_fixedfsid); 1005 uuid_getnodeuniq(&sbp->sb_uuid, mp->m_fixedfsid);
1009 1006
1010 /*
1011 * The vfs structure needs to have a file system independent
1012 * way of checking for the invariant file system ID. Since it
1013 * can't look at mount structures it has a pointer to the data
1014 * in the mount structure.
1015 *
1016 * File systems that don't support user level file handles (i.e.
1017 * all of them except for XFS) will leave vfs_altfsid as NULL.
1018 */
1019 vfsp->vfs_altfsid = (xfs_fsid_t *)mp->m_fixedfsid;
1020 mp->m_dmevmask = 0; /* not persistent; set after each mount */ 1007 mp->m_dmevmask = 0; /* not persistent; set after each mount */
1021 1008
1022 xfs_dir_mount(mp); 1009 xfs_dir_mount(mp);
@@ -1206,9 +1193,6 @@ int
1206xfs_unmountfs(xfs_mount_t *mp, struct cred *cr) 1193xfs_unmountfs(xfs_mount_t *mp, struct cred *cr)
1207{ 1194{
1208 struct bhv_vfs *vfsp = XFS_MTOVFS(mp); 1195 struct bhv_vfs *vfsp = XFS_MTOVFS(mp);
1209#if defined(DEBUG) || defined(INDUCE_IO_ERROR)
1210 int64_t fsid;
1211#endif
1212 __uint64_t resblks; 1196 __uint64_t resblks;
1213 1197
1214 /* 1198 /*
@@ -1272,11 +1256,7 @@ xfs_unmountfs(xfs_mount_t *mp, struct cred *cr)
1272 xfs_uuid_unmount(mp); 1256 xfs_uuid_unmount(mp);
1273 1257
1274#if defined(DEBUG) || defined(INDUCE_IO_ERROR) 1258#if defined(DEBUG) || defined(INDUCE_IO_ERROR)
1275 /* 1259 xfs_errortag_clearall(mp, 0);
1276 * clear all error tags on this filesystem
1277 */
1278 memcpy(&fsid, &vfsp->vfs_fsid, sizeof(int64_t));
1279 xfs_errortag_clearall_umount(fsid, mp->m_fsname, 0);
1280#endif 1260#endif
1281 XFS_IODONE(vfsp); 1261 XFS_IODONE(vfsp);
1282 xfs_mount_free(mp); 1262 xfs_mount_free(mp);