* RHEL 4 and RHEL 5/SLES 10 clients behaves differently on 'cd' to a
removed cwd "./" (refer to Bugzilla 14399).
+Severity : enhancement
+Bugzilla : 16643
+Description: Generic /proc file permissions
+Details : Set /Proc file permissions in a more generic way to enable non-
+ root users operate on some /proc files.
+
Severity : major
Bugzilla : 16561
Description: Hitting mdc_commit_close() ASSERTION
cfs_write_proc_t *write_fptr;
void *data;
struct file_operations *fops;
+ /**
+ * /proc file mode.
+ */
+ mode_t proc_mode;
};
struct lprocfs_static_vars {
}
static struct lprocfs_vars lprocfs_mdc_obd_vars[] = {
{ "uuid", lprocfs_rd_uuid, 0, 0 },
- { "ping", 0, lprocfs_wr_ping, 0 },
+ { "ping", 0, lprocfs_wr_ping, 0, 0, 0222 },
{ "connect_flags", lprocfs_rd_connect_flags, 0, 0 },
{ "blocksize", lprocfs_rd_blksize, 0, 0 },
{ "kbytestotal", lprocfs_rd_kbytestotal, 0, 0 },
static struct lprocfs_vars lprocfs_mgc_obd_vars[] = {
{ "uuid", lprocfs_rd_uuid, 0, 0 },
- { "ping", 0, lprocfs_wr_ping, 0 },
+ { "ping", 0, lprocfs_wr_ping, 0, 0, 0222 },
{ "connect_flags", lprocfs_rd_connect_flags, 0, 0 },
{ "mgs_server_uuid", lprocfs_rd_server_uuid, 0, 0 },
{ "mgs_conn_uuid", lprocfs_rd_conn_uuid, 0, 0 },
{
struct proc_dir_entry *proc;
mode_t mode = 0;
-
+
if (root == NULL || name == NULL)
return -EINVAL;
if (read_proc)
LPROCFS_ENTRY();
OBD_FAIL_TIMEOUT(OBD_FAIL_LPROC_REMOVE, 10);
if (!dp->deleted && dp->read_proc)
- rc = dp->read_proc(page, &start, *ppos, CFS_PAGE_SIZE,
+ rc = dp->read_proc(page, &start, *ppos, CFS_PAGE_SIZE,
&eof, dp->data);
LPROCFS_EXIT();
if (rc <= 0)
};
EXPORT_SYMBOL(lprocfs_evict_client_fops);
+/**
+ * Add /proc entrys.
+ *
+ * \param root [in] The parent proc entry on which new entry will be added.
+ * \param list [in] Array of proc entries to be added.
+ * \param data [in] The argument to be passed when entries read/write routines
+ * are called through /proc file.
+ *
+ * \retval 0 on success
+ * < 0 on error
+ */
int lprocfs_add_vars(struct proc_dir_entry *root, struct lprocfs_vars *list,
void *data)
{
proc_mkdir(cur, cur_root));
} else if (proc == NULL) {
mode_t mode = 0;
- if (list->read_fptr)
- mode = 0444;
- if (list->write_fptr)
- mode |= 0200;
+ if (list->proc_mode != 0000) {
+ mode = list->proc_mode;
+ } else {
+ if (list->read_fptr)
+ mode = 0444;
+ if (list->write_fptr)
+ mode |= 0200;
+ }
proc = create_proc_entry(cur, mode, cur_root);
}
}
"0x%p %s/%s len %d\n", rm_entry, temp->name,
rm_entry->name, (int)strlen(rm_entry->name));
- /* Now, the rm_entry->deleted flags is protected
+ /* Now, the rm_entry->deleted flags is protected
* by _lprocfs_lock. */
rm_entry->data = NULL;
remove_proc_entry(rm_entry->name, temp);
atomic_t *atm = data;
int val = 0;
int rc;
-
+
rc = lprocfs_write_helper(buffer, count, &val);
if (rc < 0)
return rc;
if (val <= 0)
return -ERANGE;
-
+
atomic_set(atm, val);
return count;
}
int lprocfs_obd_cleanup(struct obd_device *obd)
{
- if (!obd)
+ if (!obd)
return -EINVAL;
if (obd->obd_proc_exports_entry) {
/* Should be no exports left */
void lprocfs_free_obd_stats(struct obd_device *obd)
{
- if (obd->obd_stats)
+ if (obd->obd_stats)
lprocfs_free_stats(&obd->obd_stats);
}
2. #echo x.0x > /proc/xxx output result : x.0x
3. #echo x.x0 > /proc/xxx output result : x.x
4. #echo x.xx > /proc/xxx output result : x.xx
- Only reserved 2bits fraction.
+ Only reserved 2bits fraction.
*/
for (i = 0; i < (5 - prtn); i++)
temp_mult *= 10;
units <<= 10;
}
/* Specified units override the multiplier */
- if (units)
+ if (units)
mult = mult < 0 ? -units : units;
frac *= mult;
return 0;
}
-int lprocfs_seq_create(cfs_proc_dir_entry_t *parent,
+int lprocfs_seq_create(cfs_proc_dir_entry_t *parent,
char *name, mode_t mode,
struct file_operations *seq_fops, void *data)
{
struct file_operations *seq_fops,
void *data)
{
- return (lprocfs_seq_create(dev->obd_proc_entry, name,
+ return (lprocfs_seq_create(dev->obd_proc_entry, name,
mode, seq_fops, data));
}
EXPORT_SYMBOL(lprocfs_obd_seq_create);
obd->obd_requests_queued_for_recovery) <= 0)
goto out;
- if (lprocfs_obd_snprintf(&page, size, &len, "next_transno: "LPD64"\n",
+ if (lprocfs_obd_snprintf(&page, size, &len, "next_transno: "LPD64"\n",
obd->obd_next_recovery_transno) <= 0)
goto out;
struct obd_device *obd = (struct obd_device *)data;
LASSERT(obd != NULL);
- return snprintf(page, count, "%lu\n",
+ return snprintf(page, count, "%lu\n",
obd->obd_recovery_max_time);
}
EXPORT_SYMBOL(lprocfs_obd_rd_recovery_maxtime);
{
struct obd_device *dev = data;
int val, rc;
-
+
rc = lprocfs_write_helper(buffer, count, &val);
if (rc)
return rc;
LPROCFS_CLIMP_CHECK(dev);
/* opposite senses */
- if (dev->u.cli.cl_import->imp_deactive == val)
+ if (dev->u.cli.cl_import->imp_deactive == val)
rc = ptlrpc_set_import_active(dev->u.cli.cl_import, val);
else
CDEBUG(D_CONFIG, "activate %d: ignoring repeat request\n", val);
-
+
LPROCFS_CLIMP_EXIT(dev);
return count;
}
client_obd_list_lock(&cli->cl_loi_list_lock);
cli->cl_max_pages_per_rpc = val;
client_obd_list_unlock(&cli->cl_loi_list_lock);
-
+
LPROCFS_CLIMP_EXIT(dev);
return count;
}
client_obd_list_lock(&cli->cl_loi_list_lock);
cli->cl_max_rpcs_in_flight = val;
client_obd_list_unlock(&cli->cl_loi_list_lock);
-
+
LPROCFS_CLIMP_EXIT(dev);
return count;
}
{
struct obd_device *obd = data;
- return snprintf(page, count, "%u\n", atomic_read(&obd->u.cli.cl_resends));
+ return snprintf(page, count, "%u\n", atomic_read(&obd->u.cli.cl_resends));
}
static int osc_wr_resend_count(struct file *file, const char *buffer,
static struct lprocfs_vars lprocfs_osc_obd_vars[] = {
{ "uuid", lprocfs_rd_uuid, 0, 0 },
- { "ping", 0, lprocfs_wr_ping, 0 },
+ { "ping", 0, lprocfs_wr_ping, 0, 0, 0222 },
{ "connect_flags", lprocfs_rd_connect_flags, 0, 0 },
{ "blocksize", lprocfs_rd_blksize, 0, 0 },
{ "kbytestotal", lprocfs_rd_kbytestotal, 0, 0 },
//{ "filegroups", lprocfs_rd_filegroups, 0, 0 },
{ "ost_server_uuid", lprocfs_rd_server_uuid, 0, 0 },
{ "ost_conn_uuid", lprocfs_rd_conn_uuid, 0, 0 },
- { "active", osc_rd_active,
+ { "active", osc_rd_active,
osc_wr_active, 0 },
{ "max_pages_per_rpc", osc_rd_max_pages_per_rpc,
osc_wr_max_pages_per_rpc, 0 },
write_cum += w;
seq_printf(seq, "%d:\t\t%10lu %3lu %3lu | %10lu %3lu %3lu\n",
(i == 0) ? 0 : 1 << (i - 1),
- r, pct(r, read_tot), pct(read_cum, read_tot),
+ r, pct(r, read_tot), pct(read_cum, read_tot),
w, pct(w, write_tot), pct(write_cum, write_tot));
if (read_cum == read_tot && write_cum == write_tot)
break;